Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .intel_syntax noprefix
- .text
- .globl _start
- _start:
- mov edx,[esp+8]
- cmp edx,0
- jz koniec
- mov edx,[esp+12]
- cmp edx,0
- jz koniec
- xor edx,edx
- mov eax,4
- mov ebx,1
- mov ecx,offset msx
- mov edx,2
- int 0x80
- xor edx,edx
- mov ecx,[esp+8]
- petla:
- inc edx
- cmp byte ptr [ecx+edx-1],0
- jnz petla
- mov esi,edx
- mov eax,4
- mov ebx,1
- int 0x80
- mov eax,4
- mov ebx,1
- mov ecx,offset msy
- mov edx,3
- int 0x80
- mov ecx,[esp+12]
- xor edx, edx
- loop:
- inc edx
- cmp byte ptr [ecx+edx-1],0
- jnz loop
- mov eax,4
- mov ebx,1
- int 0x80
- mov eax,4
- mov ebx,1
- mov ecx,offset msg
- mov edx,1
- int 0x80
- xor edx,edx
- xor ecx,ecx
- mov ecx,[esp+12]
- mov ebx,[esp+8]
- mov ebp,0
- literka:
- mov ah,byte ptr[ecx+ebp]
- cmp ah,0
- jz jest
- cmp ah,byte[ebx+edx]
- jz dalej
- inc edx
- jmp reset
- reset:
- mov ebp,0
- cmp edx,esi
- jz koniec
- jmp literka
- dalej:
- inc edx
- inc ebp
- cmp edx,esi
- jz koniec
- jmp literka
- jest:
- inc edi
- jmp reset
- koniec:
- inc edi
- mov edx,48
- xor ebx,ebx
- add edx,edi
- push edx
- mov eax,4
- mov ebx,1
- mov ecx,esp
- mov edx,1
- int 0x80
- pop edx
- mov eax,4
- mov ebx,1
- mov ecx,offset msg
- mov edx,2
- int 0x80
- mov eax,1
- mov ebx,0
- int 0x80
- .data
- msg: .ascii "\n"
- msx: .ascii "x="
- msy: .ascii "\ny="
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement