Question: Use ARM Assembly Code to write Write push and pop functions. Each function needs to come back to appropriate locations in the calling section, use
Use ARM Assembly Code to write
Write push and pop functions. Each function needs to come back to appropriate locations in the calling section, use PC program counter to come back to the location where you branched. Hint: See Multiplication with program counter. You must keep track of the memory location where push will write, and pop will read the information. Hint: pushpop functions should locate at the end of your program.
At the beginning of the program, store a memory address to a register. It is x for the example below.
Move a literal value to a register. It is our student ID One digit at a time.
Prepare register or use BL for step so that it will contain the return address from push.
Branch to push function.
Repeat step so that eight digits of your student ID are pushed into a memory stack.
Prepare register or use BL for step so that it will contain the return address from pop.
Branch to pop function.
Move the popped value you may use one of the registers for holding the popped value. into register R for the first value, then R for the second, and so on
Repeat step so that will be filled. The resulting order will be the reversed order of your student ID
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
