Question: Modify the follow code to print out the result in ARMv8 assembly language run on rasbian (not C or else) Giving information: @1. Print the

Modify the follow code to print out the result in ARMv8 assembly language run on rasbian (not C or else)

Giving information:

@1. Print the result of 1 +2 +3 +4 +5 +6 +7 = 28

@2. Use this format string "Total of %d + %d + %d + %d + %d + %d + %d = %d"

@modify the code below to get the result

.data

string1: .asciz " Total of %d + %d + %d + %d + %d + %d + %d = %d "

a: .word 1

b: .word 2

c:. word 3

.text

.global main

.extern printf

.func main

main:

push {ip, lr}

ldr r1, =a

ldr r1, [r1]

ldr r2, =b

ldr r2, [r2]

add r1, r1, r2

ldr r2, =c

str r1, [r2]

ldr r0, =string1

ldr r1, [r2]

bl printf

pop {ip, pc}

complie in terminal :

as -o file.o file.s

gcc -o file file.o

./file

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!