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

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 why you did it.
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

====== 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


==== General ideas 1. P2 extends the P1 code to print a 2-digit unsigned integer. The objective is to understand why ARMv8 is best known as the "load \& store" ISA. Your code will be tested with a different integer. 2. For the time being, do not worry about the code outside of BEGIN/END as stated below; it will be explained in full later. Concentrate on transforming the 1 register using load \& store mechanism as discussed in class, so that it can be printed by syscall \#64 . ==== Submission requirements 1. Use the baseline code below per our in-class discussion. Follow the requirements closely. 2. Your submission should include: 1) p2_lastname.s, and 2) a screenshot showing the gdb session displaying the value of the x1 register after it has been transformed for memory examination. Basically, x1 initially holds an int, and your assembly code needs to transform it so that the initial int can be printed with the \#64 syscall outside of the BEGIN/END block. 3. Your code should not invoke any other library call inside the BEGIN/END pair. Hard wire a string to represent the integer will not earn credit. 4. Please do NOT submit a zip file. Upload two files to Canvas: .s and.pdf

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!