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 policz
- push eax
- mov eax, offset printf_arg1
- push eax
- call printf
- add esp, 12
- ret
- exit:
- mov eax, 0
- ret
- policz:
- mov ebp, [esp + 4];
- mov ecx, 1;
- jmp petla;
- petla:
- inc ebp;
- mov bl, [ebp];
- cmp bl, ' ';
- je jestSpacja;
- cmp bl, 0;
- je jestKoniec;
- jmp petla;
- jestSpacja:
- inc ebp;
- mov bl, [ebp];
- cmp bl, ' ';
- je jestSpacja;
- cmp bl, 0;
- je jestKoniec;
- inc ecx;
- jmp petla;
- jestKoniec:
- mov eax, ecx;
- ret;
- .data
- messg:
- .asciz "Przykladowe zdanie lol aaa"
- printf_arg1:
- .asciz "%i\n"
Add Comment
Please, Sign In to add comment