mirror of
https://github.com/pkivolowitz/asm_book.git
synced 2026-06-21 00:26:46 +08:00
changed tabs to spaces in nine_args.s
This commit is contained in:
parent
73bad628b4
commit
f1dd2bea49
1 changed files with 28 additions and 28 deletions
|
|
@ -1,5 +1,5 @@
|
|||
.text
|
||||
.global main
|
||||
.text
|
||||
.global main
|
||||
|
||||
/* Demonstration of using more than 8 arguments to a function. This
|
||||
demo is LINUX only as APPLE will put all arguments beyond the first
|
||||
|
|
@ -11,35 +11,35 @@
|
|||
*/
|
||||
|
||||
SillyFunction:
|
||||
stp x29, x30, [sp, -16]! // Changes sp.
|
||||
stp x29, x30, [sp, -16]! // Changes sp.
|
||||
mov x29, sp
|
||||
ldr x0, =fmt
|
||||
mov x1, x7
|
||||
ldr x2, [sp, 16] // This does not alter the sp.
|
||||
bl printf
|
||||
ldp x29, x30, [sp], 16 // Undoes change to sp.
|
||||
ret
|
||||
ldr x0, =fmt
|
||||
mov x1, x7
|
||||
ldr x2, [sp, 16] // This does not alter the sp.
|
||||
bl printf
|
||||
ldp x29, x30, [sp], 16 // Undoes change to sp.
|
||||
ret
|
||||
|
||||
main:
|
||||
stp x29, x30, [sp, -16]! // sp down total of 16.
|
||||
main:
|
||||
stp x29, x30, [sp, -16]! // sp down total of 16.
|
||||
mov x29, sp
|
||||
mov x0, 9
|
||||
str x0, [sp, -16]! // sp down total of 32.
|
||||
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 x0, 9
|
||||
str x0, [sp, -16]! // sp down total of 32.
|
||||
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
|
||||
add sp, sp, 16 // undoes change of sp by 16 due
|
||||
// to function call.
|
||||
ldp x29, x30, [sp], 16 // undoes change to sp of 16.
|
||||
ret
|
||||
|
||||
.data
|
||||
fmt: .asciz "This example hurts my brain: %ld %ld\n"
|
||||
ldp x29, x30, [sp], 16 // undoes change to sp of 16.
|
||||
ret
|
||||
|
||||
.data
|
||||
fmt: .asciz "This example hurts my brain: %ld %ld\n"
|
||||
|
||||
.end
|
||||
.end
|
||||
|
|
|
|||
Loading…
Reference in a new issue