Advertisement
Guest User

scanf

a guest
Feb 18th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. global main
  2.  
  3. extern printf
  4. extern scanf
  5.  
  6.  
  7. section .data
  8.   scan_2d db '%d %d',10, 0
  9. section .bss
  10.   N: resb 4
  11.   K: resb 4
  12.  
  13. section .text
  14. main:
  15.  
  16.   push ebp
  17.   mov ebp, esp
  18.  
  19.   push K
  20.   push N
  21.   push scan_2d
  22.   call scanf
  23.   add esp, 12
  24.  
  25.   push dword[K]
  26.   push dword[N]
  27.   push scan_2d
  28.   call printf
  29.   add esp, 12
  30.  
  31.  
  32.   mov esp, ebp
  33.   pop ebp
  34.   mov eax, 0
  35.   ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement