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: push/pop functions should locate at the end of your program.)
(2) At the beginning of the program, store a memory address to a register. It is 0x1000 for the example below.
(3) Move a literal value to a register. It is our student ID. One digit at a time.
(4) Prepare register 12(or use BL for step 5), so that it will contain the return address from push.
(5) Branch to push function.
(6) Repeat step 35, so that eight digits of your student ID are pushed into a memory stack.
(7) Prepare register 12(or use BL for step 8), so that it will contain the return address from pop.
(8) Branch to pop function.
(9) Move the popped value (you may use one of the registers for holding the popped value.) into register 1(R1), for the first value, then R2 for the second, and so on.
(10) Repeat step 79, so that R1R8 will be filled. The resulting order will be the reversed order of your student ID.
Use ARM Assembly Code to write Write push and pop

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 Programming Questions!