Advertisement
Guest User

Untitled

a guest
Jan 7th, 2019
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .intel_syntax noprefix
  2. .global _start
  3. .text
  4.     _start:
  5.         mov ecx, [esp+8]
  6.  
  7.         fCon:
  8.             xor edx, edx
  9.             mov eax, ecx
  10.             mov bl, [eax]
  11.  
  12.             cmp bl, 0
  13.             je end
  14.             cmp bl, 'p'
  15.             je sCon
  16.             cmp bl, 'q'
  17.             je sCon
  18.             cmp bl, 'r'
  19.             je sCon
  20.  
  21.             jmp nextChar
  22.  
  23.         sCon:
  24.             inc edx
  25.             inc eax
  26.             mov bl, [eax]
  27.  
  28.             cmp bl, 0
  29.             je end
  30.             cmp bl, 'q'
  31.             je nextChar
  32.             cmp bl, 'r'
  33.             je checkTCon
  34.  
  35.             jmp sCon
  36.  
  37.         checkTCon:
  38.             inc edx
  39.             inc eax
  40.             mov bl, [eax]
  41.  
  42.             cmp bl, 'a'
  43.             je print
  44.  
  45.         nextChar:
  46.             inc ecx
  47.             jmp fCon
  48.  
  49.         print:
  50.             inc edx
  51.             mov eax, 4
  52.             mov ebx, 1
  53.             int 0x80
  54.             mov eax, 4
  55.             mov ebx, 1
  56.             mov ecx, offset newLine
  57.             mov edx, 1
  58.             int 0x80
  59.  
  60.         end:
  61.             mov eax, 1
  62.             mov ebx, 0
  63.             int 0x80
  64.  
  65. .data
  66.     newLine: .asciz "\n"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement