Advertisement
intsashka

Untitled

May 26th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. %include "io.inc"
  2.  
  3. CEXTERN printf
  4. CEXTERN scanf
  5. section .rodata
  6.     get db "%u", 0
  7.     set db "0x%08X", `\n`, 0
  8.    
  9. section .text
  10. global CMAIN
  11. CMAIN:
  12.     push ebp
  13.     mov ebp, esp
  14.     and esp, -16
  15.     sub esp, 16
  16.    
  17.     .read:
  18.    
  19.         lea eax, [esp+12]
  20.         mov dword[esp+4], eax
  21.         mov dword[esp], get
  22.         call scanf
  23.        
  24.         cmp eax, 1
  25.         jnz .end
  26.        
  27.         mov eax, dword[esp+12]
  28.         mov dword[esp+4], eax
  29.         mov dword[esp], set
  30.         call printf
  31.         jmp .read
  32.     .end:
  33.            
  34.     leave
  35.     xor eax, eax
  36.     ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement