projects
/
asm_demo.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7f05141
)
asm.s
author
yu.dongliang
<18588496441@163.com>
Sat, 13 Dec 2025 13:52:25 +0000
(21:52 +0800)
committer
yu.dongliang
<18588496441@163.com>
Sat, 13 Dec 2025 13:52:25 +0000
(21:52 +0800)
asm.s
patch
|
blob
|
blame
|
history
diff --git
a/asm.s
b/asm.s
index e92ef741698b27bbd323479d713ad18c8b75d3d3..ecebc7184f505fb12c0fbe8326a10a4511274186 100644
(file)
--- a/
asm.s
+++ b/
asm.s
@@
-7,7
+7,7
@@
asm_main:
#rsi = argv
#rdx = envp
cmp $2, %rdi
- jl
5f
+ jl
_print_usage
mov 8(%rsi), %rdi
0:
@@
-55,3
+55,12
@@
asm_main:
jmp 0b
6:
ret
+_print_usage:
+ push %rdi
+ leaq usage, %rdi
+ mov $0, %eax
+ call printf
+ pop %rdi
+ ret
+.data
+usage: .asciz "./a.out asm_code\n"