Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .intel_syntax noprefix
- .global main
- .text
- main:
- mov eax, [esp+8]
- mov eax, [eax+4]
- p1:
- mov ebx,eax
- mov ecx,1
- mov dh,byte ptr [eax]
- cmp dh,'p'
- je p2
- cmp dh,'q'
- je p2
- cmp dh,'r'
- je p2
- inc eax
- jmp p1
- p2:
- inc eax
- inc ecx
- mov dh,byte ptr [eax]
- cmp dh,'q'
- je p1
- cmp dh,'r'
- je p1
- r:
- inc eax
- inc ecx
- mov dh,byte ptr [eax]
- cmp dh,'r'
- je prin
- cmp dh,'q'
- je p1
- jmp r
- prin:
- mov eax,ebx
- printchar:
- xor ebx,ebx
- push ecx
- mov bl,byte ptr [eax]
- push eax
- push ebx
- mov ebx, offset messg
- push ebx
- call printf
- add esp,8
- pop eax
- pop ecx
- dec ecx
- inc eax
- cmp ecx,0
- jne printchar
- #znak nowej lini dla wygladu
- mov ebx, offset nl
- push ebx
- call printf
- add esp,4
- xor eax,eax
- ret
- .data
- nl: .asciz "\n"
- messg: .asciz "%c"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement