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