mad1231999

Untitled

Apr 26th, 2013
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. section .data
  2. prnt_fmt:       db "Hello, World!", 0x0a
  3. msg:            db "Printing!",     0x0a
  4. msg_len:        equ $-msg
  5.  
  6. section .text
  7. global main
  8. extern printf
  9.  
  10. main:
  11.         mov     dx, 10          ; amount of numbers to find
  12.         push    0x00
  13.         push    0x00            ; two first values
  14.  
  15.         loop_start:
  16.                 xor     eax, eax        ; make sure that eax is 0
  17.                 pop     bx
  18.                 add     eax, ebx
  19.                 pop     bx
  20.                 add     eax, ebx
  21.  
  22.                 push    bx
  23.                 push    ax
  24.  
  25.                 push    dx
  26.                 mov     eax, 0x04
  27.                 mov     ebx, 0x01
  28.                 mov     ecx, msg
  29.                 mov     edx, msg_len
  30.                 int     0x80
  31.                 pop     dx
  32.  
  33.                 push    prnt_fmt
  34.                 call    printf
  35.                 pop     cx
  36.  
  37.                 dec     dx
  38.                 cmp     dx, 0x00
  39.                 jge     loop_start
  40.  
  41.         mov     eax, 0x01       ; exit
  42.         mov     ebx, 0x00
  43.         int     0x80
Advertisement
Add Comment
Please, Sign In to add comment