Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PLEASE WRITE CODE IN ARM ASSEMBLY MACHINE LANGUAGE!!!! DO NOT WRITE CODE IN ANY OTHER LANGUAGE PLEASE. PLEASE MAKE SURE THAT THE CODE COMPILES!! THANK

PLEASE WRITE CODE IN ARM ASSEMBLY MACHINE LANGUAGE!!!! DO NOT WRITE CODE IN ANY OTHER LANGUAGE PLEASE.

PLEASE MAKE SURE THAT THE CODE COMPILES!!

THANK YOU!!!!!

image text in transcribed

Write an ARM program that takes takes an input n and uses recursion to print n down to zero and back to n. Here is sample output [root@debian-aarch 4:/ workdir\# gcc -o printfun printfun.s g ir[root@debian-aarch64: /workdir\#./printfun [Please enter a number: 4 iP i 3 i 2 is 1 ir 0 i 2 i 3 i 4 is root@debian-aarch64: /workdir\# Here is the ct+ code for the procedure. (This is simply meant to help you understand the assignment!!) Requirements and Specifications Your inputs n cannot be stored as a global variable at any point. This means you cannot store them at a data section address, even when accepting them from scanf; they must be returned from scanf on the stack. X19X27 are global variables. You may not use X19X27 in your recursive function. If you want, you may use X19X27 in your main function. You can use any registers you want to in your main function. A recursion procedure requires: - Allocate stack space - Save the return address and argument on the stack. - Recursively call procedure with BL - Unwind the stack by restoring the return address and arguments and deallocating stack memory Hints and Warnings You must put the argument and return address on the stack before any bl call, and restore the argument and the return address after the bl call. This includes every printf call and every recursive call

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning ASP.NET 4.5 Databases

Authors: Sandeep Chanda, Damien Foggon

3rd Edition

1430243805, 978-1430243809

More Books

Students also viewed these Databases questions

Question

Question Can employees make contributions to a profit sharing plan?

Answered: 1 week ago

Question

What are Decision Trees?

Answered: 1 week ago

Question

What is meant by the Term Glass Ceiling?

Answered: 1 week ago