Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .intel_syntax noprefix
- .globl main
- .text
- main:
- mov eax, offset messg
- push eax
- call znajdz
- push eax
- mov eax, offset printf_arg1
- push eax
- call printf
- add esp, 12
- ret
- exit:
- mov eax, 0
- ret
- znajdz:
- xor ecx, ecx;
- mov ebp, [esp + 4];
- dec ebp;
- jmp petla;
- petla:
- inc ebp;
- mov bl, [ebp];
- cmp bl, '*';
- je jestZnak;
- cmp bl, 0;
- je koniecPetli;
- jmp petla;
- jestZnak:
- inc ecx;
- jmp petla;
- koniecPetli:
- cmp ecx, 0;
- je znakNieWystapil;
- mov eax, ecx;
- ret;
- znakNieWystapil:
- mov eax, -1;
- ret;
- .data
- messg:
- .asciz "*testerino *uuer*"
- printf_arg1:
- .asciz "%i\n"
Advertisement
Add Comment
Please, Sign In to add comment