SHARE
TWEET

Untitled

a guest Feb 22nd, 2019 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. section         .text
  2.  
  3. global _start
  4.  
  5. division:
  6.     xor dx, dx
  7.     mov cx, 10
  8.     div cx
  9.     mov si, 48
  10.     add dx, si
  11.    
  12.     add si, 1
  13.     ;mov [msg + esp], dx
  14.  
  15.     push dx
  16.     ;add esp, 1
  17.     cmp ax, 0
  18.     jne division
  19.  
  20.     ret
  21.  
  22. extract:
  23.     pop word [msg + esp]
  24.     add esp, 1
  25.     sub si, 1
  26.  
  27.     cmp si, 0
  28.     jne extract
  29.     ret
  30.  
  31. _start:
  32.     std
  33.  
  34.     xor si, si
  35.     mov ax, 748
  36.     push ax
  37.     xor edi, edi
  38.     call division
  39.  
  40.     mov             rax, 1
  41.     mov             rdi, 1
  42.     mov             rsi, msg
  43.     mov             rdx, msg_size
  44.     syscall
  45.  
  46.     mov             rax, 60
  47.     xor             rdi, rdi
  48.     syscall
  49.  
  50.  
  51. section      .data
  52.  
  53.     msg          dw         "                                                                                     ",0x0a
  54.     msg_size:       equ             $ -msg
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top