Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .intel_syntax noprefix
- .text
- .globl main
- main:
- mov eax,offset messg
- push eax
- call policz
- push eax
- mov eax,offset printf_arg1
- push eax
- call printf
- add esp,8
- exit:
- mov eax,0
- ret
- policz:
- push esi
- mov esi,[esp+8]
- mov eax,0
- spacjousuwacz:
- cmpb [esi],0
- je koniecstring
- cmpb [esi],' '
- jne wyraz
- inc esi
- jmp spacjousuwacz
- wyraz:
- inc eax
- przewijamwyraz:
- inc esi
- cmpb [esi],0
- je koniecstring
- cmpb [esi],' '
- je spacjousuwacz
- jmp przewijamwyraz
- koniecstring:
- pop esi
- ret 4
- .data
- messg:
- .asciz "a bc d"
- printf_arg1:
- .asciz "%i"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement