Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @ define system
- .cpu cortex-a53
- .fpu neon-fp-armv8
- .syntax unified @ modern syntax
- @ constant data
- .section .rodata
- .align 2
- resultMsg:
- .asciz "The sum is %i\n"
- @ program
- .text
- .align 2
- .global main
- .type main, %function
- main:
- @ stack:
- @ 0: lr
- @ -4: a = 1 <-- sp + 32
- @ -8: b = 2 <-- sp + 28
- @ -12: c = 3 <-- sp + 24
- @ -16: d = 4 <-- sp + 20
- @ -20: e = 5 <-- sp + 16
- @ -24: f = 6 <-- sp + 12
- @ -28: g = 7 <-- sp + 8
- @ -32: h = 8 <-- sp + 4
- @ -36: i = 9 <-- sp
- push { lr }
- @ a = 1
- mov r0, 1
- push { r0 }
- @ b = 2
- mov r0, 2
- push { r0 }
- @ c = 3
- mov r0, 3
- push { r0 }
- @ d = 4
- mov r0, 4
- push { r0 }
- @ e = 5
- mov r0, 5
- push { r0 }
- @ f = 6
- mov r0, 6
- push { r0 }
- @ g = 7
- mov r0, 7
- push { r0 }
- @ h = 8
- mov r0, 8
- push { r0 }
- @ i = 9
- mov r0, 9
- push { r0 }
- bl sumNine
- mov r1, r0
- @ print total
- ldr r0, resultMsgAddr
- @ total already in r1
- bl printf
- mov r0, 0 @ return 0;
- add sp, sp, 36
- pop { pc }
- .align 2
- resultMsgAddr:
- .word resultMsg
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement