Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .intel_syntax noprefix
- .global _start
- .text
- _start:
- mov ecx, [esp+8]
- fCon:
- xor edx, edx
- mov eax, ecx
- mov bl, [eax]
- cmp bl, 0
- je end
- cmp bl, 'p'
- je sCon
- cmp bl, 'q'
- je sCon
- cmp bl, 'r'
- je sCon
- jmp nextChar
- sCon:
- inc edx
- inc eax
- mov bl, [eax]
- cmp bl, 0
- je end
- cmp bl, 'q'
- je nextChar
- cmp bl, 'r'
- je checkTCon
- jmp sCon
- checkTCon:
- inc edx
- inc eax
- mov bl, [eax]
- cmp bl, 'a'
- je print
- nextChar:
- inc ecx
- jmp fCon
- print:
- inc edx
- mov eax, 4
- mov ebx, 1
- int 0x80
- mov eax, 4
- mov ebx, 1
- mov ecx, offset newLine
- mov edx, 1
- int 0x80
- end:
- mov eax, 1
- mov ebx, 0
- int 0x80
- .data
- newLine: .asciz "\n"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement