Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- section .data
- prnt_fmt: db "Hello, World!", 0x0a
- msg: db "Printing!", 0x0a
- msg_len: equ $-msg
- section .text
- global main
- extern printf
- main:
- mov dx, 10 ; amount of numbers to find
- push 0x00
- push 0x00 ; two first values
- loop_start:
- xor eax, eax ; make sure that eax is 0
- pop bx
- add eax, ebx
- pop bx
- add eax, ebx
- push bx
- push ax
- push dx
- mov eax, 0x04
- mov ebx, 0x01
- mov ecx, msg
- mov edx, msg_len
- int 0x80
- pop dx
- push prnt_fmt
- call printf
- pop cx
- dec dx
- cmp dx, 0x00
- jge loop_start
- mov eax, 0x01 ; exit
- mov ebx, 0x00
- int 0x80
Advertisement
Add Comment
Please, Sign In to add comment