The decimal-to-binary conversion program of Problem 3.16 is to be implemented us- ing two nested subroutines. The
Question:
The decimal-to-binary conversion program of Problem 3.16 is to be implemented us- ing two nested subroutines. The main program that calls the first subroutine passes two parameters by pushing them onto the stack whose pointer register is R13. The first parameter is the address of a 3-byte memory buffer area for storing the input decimal-digit characters. The second parameter is the address of the location where the converted binary value is to be stored. The first subroutine reads in the three characters from the keyboard and then calls the second subroutine to perform the conversion. The necessary parameters are passed to this subroutine via the processor registers. Both subroutines must save the contents of any registers that they use on the stack.
(a) Write the two subroutines for the ARM processor.
(b) Give the contents of the stack immediately after the execution of the instruction that calls the second subroutine.
Step by Step Answer:
Computer Organization
ISBN: 9780072320862
5th Edition
Authors: V Carl Hamacher, Carl Hamacher, Zvonko G Vranesic, Safwat G Zaky