The decimal-to-binary conversion program of Problem 3.65 is to be implemented us- ing two nested subroutines. The

Question:

The decimal-to-binary conversion program of Problem 3.65 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 processor stack. 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 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 IA-32 processor.

(b) Give the contents of the processor stack immediately after the execution of the instruction that calls the second subroutine.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

Computer Organization

ISBN: 9780072320862

5th Edition

Authors: V Carl Hamacher, Carl Hamacher, Zvonko G Vranesic, Safwat G Zaky

Question Posted: