From f706e3692dda6ce2b605b67b41807887404953cb Mon Sep 17 00:00:00 2001 From: "yu.dongliang" <18588496441@163.com> Date: Sat, 13 Dec 2025 21:52:25 +0800 Subject: [PATCH] asm.s --- asm.s | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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" -- 2.25.1