mirror of
https://github.com/pkivolowitz/asm_book.git
synced 2026-06-21 06:26:49 +08:00
103 lines
2.5 KiB
ArmAsm
103 lines
2.5 KiB
ArmAsm
.section __TEXT,__text,regular,pure_instructions
|
|
.build_version macos, 13, 0 sdk_version 13, 1
|
|
.globl _LessSillyFunction ; -- Begin function LessSillyFunction
|
|
.p2align 2
|
|
_LessSillyFunction: ; @LessSillyFunction
|
|
.cfi_startproc
|
|
; %bb.0:
|
|
sub sp, sp, #96
|
|
stp x29, x30, [sp, #80] ; 16-byte Folded Spill
|
|
add x29, sp, #80
|
|
.cfi_def_cfa w29, 16
|
|
.cfi_offset w30, -8
|
|
.cfi_offset w29, -16
|
|
stur x0, [x29, #-8]
|
|
stur x1, [x29, #-16]
|
|
stur x2, [x29, #-24]
|
|
stur x3, [x29, #-32]
|
|
str x4, [sp, #40]
|
|
str x5, [sp, #32]
|
|
str x6, [sp, #24]
|
|
str x7, [sp, #16]
|
|
ldr x8, [sp, #16]
|
|
mov x9, sp
|
|
str x8, [x9]
|
|
adrp x0, l_.str@PAGE
|
|
add x0, x0, l_.str@PAGEOFF
|
|
bl _printf
|
|
ldp x29, x30, [sp, #80] ; 16-byte Folded Reload
|
|
add sp, sp, #96
|
|
ret
|
|
.cfi_endproc
|
|
; -- End function
|
|
.globl _SillyFunction ; -- Begin function SillyFunction
|
|
.p2align 2
|
|
_SillyFunction: ; @SillyFunction
|
|
.cfi_startproc
|
|
; %bb.0:
|
|
sub sp, sp, #112
|
|
stp x29, x30, [sp, #96] ; 16-byte Folded Spill
|
|
add x29, sp, #96
|
|
.cfi_def_cfa w29, 16
|
|
.cfi_offset w30, -8
|
|
.cfi_offset w29, -16
|
|
ldr x8, [x29, #16]
|
|
stur x0, [x29, #-8]
|
|
stur x1, [x29, #-16]
|
|
stur x2, [x29, #-24]
|
|
stur x3, [x29, #-32]
|
|
stur x4, [x29, #-40]
|
|
str x5, [sp, #48]
|
|
str x6, [sp, #40]
|
|
str x7, [sp, #32]
|
|
str x8, [sp, #24]
|
|
ldr x10, [sp, #32]
|
|
ldr x8, [sp, #24]
|
|
mov x9, sp
|
|
str x10, [x9]
|
|
str x8, [x9, #8]
|
|
adrp x0, l_.str.1@PAGE
|
|
add x0, x0, l_.str.1@PAGEOFF
|
|
bl _printf
|
|
ldp x29, x30, [sp, #96] ; 16-byte Folded Reload
|
|
add sp, sp, #112
|
|
ret
|
|
.cfi_endproc
|
|
; -- End function
|
|
.globl _main ; -- Begin function main
|
|
.p2align 2
|
|
_main: ; @main
|
|
.cfi_startproc
|
|
; %bb.0:
|
|
sub sp, sp, #32
|
|
stp x29, x30, [sp, #16] ; 16-byte Folded Spill
|
|
add x29, sp, #16
|
|
.cfi_def_cfa w29, 16
|
|
.cfi_offset w30, -8
|
|
.cfi_offset w29, -16
|
|
mov x9, sp
|
|
mov x8, #9
|
|
str x8, [x9]
|
|
mov x0, #1
|
|
mov x1, #2
|
|
mov x2, #3
|
|
mov x3, #4
|
|
mov x4, #5
|
|
mov x5, #6
|
|
mov x6, #7
|
|
mov x7, #8
|
|
bl _SillyFunction
|
|
mov w0, #0
|
|
ldp x29, x30, [sp, #16] ; 16-byte Folded Reload
|
|
add sp, sp, #32
|
|
ret
|
|
.cfi_endproc
|
|
; -- End function
|
|
.section __TEXT,__cstring,cstring_literals
|
|
l_.str: ; @.str
|
|
.asciz "This example hurts my brain: %ld\n"
|
|
|
|
l_.str.1: ; @.str.1
|
|
.asciz "This example hurts my brain: %ld %ld\n"
|
|
|
|
.subsections_via_symbols
|