Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- segment .data
- komunikat db "Podaj łańcuch znaków: ", 0
- format db "%s", 0
- znak db "%c", 0
- spacja db " ", 0
- tekst times 4096 db 0
- segment .text
- global main
- extern printf
- extern scanf
- main:
- push ebp
- mov ebp, esp
- push komunikat
- call printf
- add esp, 4
- push tekst
- push format
- call scanf
- add esp, 8
- call wypisz_pierwsze
- push spacja
- call printf
- add esp, 4
- call wypisz_ostatnie
- pop ebp
- ret
- wypisz_pierwsze:
- push ebp
- mov ebp, esp
- mov eax, tekst
- .petla:
- cmp byte [eax], 0
- je .petla_koniec
- push eax
- push dword [eax]
- push znak
- call printf
- add esp, 8
- pop eax
- inc eax
- jmp .petla
- .petla_koniec:
- pop ebp
- ret
- wypisz_ostatnie:
- push ebp
- mov ebp, esp
- pop ebp
- ret
Advertisement
Add Comment
Please, Sign In to add comment