Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the following global variable declarations: Consider the following global variable declarations: A) Write the main program that will call the subroutine SUB and will

Consider the following global variable declarations:

image text in transcribed

Consider the following global variable declarations: A) Write the main program that will call the subroutine SUB and will pass data items DATA1 and DATA2 to that subroutine using "call-by-reference over the stack". The subroutine will pass back a 1-byte data item through "call-by-value in register". The main program will then store the data item passed back from the subroutine into RESULT (do not forget to initialize any crucial processor registers and to terminate your program correctly with an infinite loop.) B) Write the subroutine SUB that will retrieve the data items passed by the main program using "call-by-reference over the stack" (that you implemented in A) and pass the 1-byte sum of those data items through "call-by-value in register" back to the main program. The subroutine must not use the labels DATA1, DATA2, or RESULT. Also, make sure that the stack will not grow infinitely or will suffer from underflow in case the subroutine is called multiple times. Consider the following global variable declarations: A) Write the main program that will call the subroutine SUB and will pass data items DATA1 and DATA2 to that subroutine using "call-by-reference over the stack". The subroutine will pass back a 1-byte data item through "call-by-value in register". The main program will then store the data item passed back from the subroutine into RESULT (do not forget to initialize any crucial processor registers and to terminate your program correctly with an infinite loop.) B) Write the subroutine SUB that will retrieve the data items passed by the main program using "call-by-reference over the stack" (that you implemented in A) and pass the 1-byte sum of those data items through "call-by-value in register" back to the main program. The subroutine must not use the labels DATA1, DATA2, or RESULT. Also, make sure that the stack will not grow infinitely or will suffer from underflow in case the subroutine is called multiple times

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Computer Aided Database Design

Authors: Antonio Albano, Valeria De Antonellis, A. Di Leva

1st Edition

0444877355, 978-0444877352

Students also viewed these Databases questions