Question: Section 2.4: Subroutines using the program stack Data relating to two lines are currently stored in memory as follows: 5000 - slope of line 1

Section 2.4: Subroutines using the program stack

Data relating to two lines are currently stored in memory as follows:

5000 - slope of line 1

5004 - x-coordinate of line 1

5008 - y-intercept of line 1

5012 - slope of line 2

5016 - x-coordinate of line 2

5020 - y-intercept of line 2

Write a program to calculate the y-coordinate of each line. You must use a subroutine to calculate the y-coordinate, and you must use the program stack for subroutine arguments and return value. Store the y-coordinate of line 1 to address 5024 and the y-coordinate of line 2 to 5028.

I highly recommend using the MIPSzy Simulator in section 2.10 to check your results.

Section 2.4: Subroutines using the program stack Data relating to two lines

Question 15 20 pts Section 2.4: Subroutines using the program stack Data relating to two lines are currently stored in memory as follows: 5000 - slope of line 1 5004 - X-coordinate of line 1 5008 - y-intercept of line 1 5012 - slope of line 2 5016 - X-coordinate of line 2 5020 - y-intercept of line 2 Write a program to calculate the y-coordinate of each line. You must use a subroutine to calculate the y-coordinate, and you must use the program stack for subroutine arguments and return value. Store the y-coordinate of line 1 to address 5024 and the y-coordinate of line 2 to 5028. I highly recommend using the MIPSzy Simulator in section 2.10 to check your results. Question 15 20 pts Section 2.4: Subroutines using the program stack Data relating to two lines are currently stored in memory as follows: 5000 - slope of line 1 5004 - X-coordinate of line 1 5008 - y-intercept of line 1 5012 - slope of line 2 5016 - X-coordinate of line 2 5020 - y-intercept of line 2 Write a program to calculate the y-coordinate of each line. You must use a subroutine to calculate the y-coordinate, and you must use the program stack for subroutine arguments and return value. Store the y-coordinate of line 1 to address 5024 and the y-coordinate of line 2 to 5028. I highly recommend using the MIPSzy Simulator in section 2.10 to check your results

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