PracticeDev/study_assembly_x86/main.s

45 lines
761 B
ArmAsm
Raw Normal View History

2024-09-04 16:20:54 +08:00
.file "main.c"
.text
.globl add_a_and_b
.type add_a_and_b, @function
add_a_and_b:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
movl %edi, -4(%rbp)
movl %esi, -8(%rbp)
movl -4(%rbp), %edx
movl -8(%rbp), %eax
imul %edx, %eax
popq %rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size add_a_and_b, .-add_a_and_b
.globl main
.type main, @function
main:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
movl $3, %esi
movl $2, %edi
call add_a_and_b
popq %rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size main, .-main
.ident "GCC: (GNU) 14.1.1 20240720"
.section .note.GNU-stack,"",@progbits