Created
May 12, 2022 12:42
-
-
Save ancientstraits/8bf93acaaff8a3f5df911af890696ecc to your computer and use it in GitHub Desktop.
print all arguments in x64 asm
This file contains 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
global main | |
extern puts | |
main: | |
push rbp | |
mov rbx, rdi | |
.loop: | |
push rsi | |
mov rdi, [rsi] | |
call puts | |
pop rsi | |
add rsi, 8 | |
sub rbx, 1 | |
cmp rbx, 0 | |
je .end | |
jmp .loop | |
.end: | |
mov rax, 0 | |
pop rbp | |
ret |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment