From: yu.dongliang <18588496441@163.com> Date: Sat, 13 Dec 2025 13:52:25 +0000 (+0800) Subject: asm.s X-Git-Url: http://baseworks.info/?a=commitdiff_plain;h=f706e3692dda6ce2b605b67b41807887404953cb;p=asm_demo.git asm.s --- diff --git a/asm.s b/asm.s index e92ef74..ecebc71 100644 --- 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"