Created
March 3, 2011 21:06
-
-
Save fbs/853557 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| extern printf | |
| section .rodata ; data section | |
| pstr: db "rax = %d",10,0 ; rax = %d\n\0 | |
| num: dq 5 | |
| section .text ; code section | |
| global main ; make label available to linker | |
| main: ; standard gcc entry point | |
| push rbp | |
| mov rbp, rsp | |
| mov qword rax, [num] | |
| ; push pstr | |
| ; push rax | |
| mov rsi, 5 | |
| mov rdi, pstr | |
| call printf | |
| add rsp, 24 | |
| mov rsp, rbp | |
| pop rbp | |
| mov rax, 0 | |
| ret | |
| leave |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment