Question
I have no idea what im supposed to do or how to do it, I'd really appreciate steps with an explanation so I can understand
====== p2_yw.s code template
.equ locals, 8
.global _start
_start:
sub sp, sp, #16 // space for fp, lr
str fp, [sp, #0] // save fp
str lr, [sp, #8] // and lr
add fp, sp, #8 // set our frame pointer
sub sp, sp, locals // space for locals
mov x1, 85 // number #85 is to to be printed
// the code above should NOT be modified
// BEGIN
// add your code here to enable the print of int
// END
// the code below should NOT be modified, except the .data section
mov x0, #1
mov x1, x1 // redundant; just to show you
mov x2, #3 // x1 is part of the sys call
mov x8, #64
svc 0
mov x0, #0
add sp, sp, locals
ldr fp, [sp, #0]
ldr lr, [sp, #8]
add sp, sp, #16
/* syscall exit(int status) */
mov x0, #0 /* status := 0 */
mov x8, #93 /* exit is syscall #1 */
svc #0 /* invoke syscall */
// YOU MAY ADD a .data or other directives BELOW
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started