The decimal-to-binary conversion program of Problem 3.40 is to be implemented as two nested subroutines. The main
Question:
The decimal-to-binary conversion program of Problem 3.40 is to be implemented as two nested subroutines. The main program that calls the first subroutine passes two parameters by pushing them onto the processor stack. The first parameter is the ad- dress of a 3-byte memory buffer area for storing the input decimal-digit characters. The second parameter is the address of the location for the converted binary value. 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 processor stack.
(a) Write the two subroutines for the 68000 processor.
(b) Give the contents of the processor 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