Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please explain the answer step by step Stack and subroutine Refer the following code snippet ORG $400 420 422 JSR MOVE.B checksum D1, DO Subroutine:

Please explain the answer step by step

image text in transcribed

Stack and subroutine Refer the following code snippet ORG $400 420 422 JSR MOVE.B checksum D1, DO Subroutine: CHECKSUM (starting address: $482) * * ****************************** ZERO BOU 0000 482 checksum MOVEM. L A1/DO-D1,-(SP) 486 LEA $4000, A1 500 exit MOVEML (SP) +,DO-D1/A1 504 RTS Before go to the subroutine, suppose that the SP currently has a value $8000 DO has $00000123, D1 has $120008A7, A1 has 500600000 Suppose checksum MOVEML AIDO-D1.-(SP) has called Answer the following: What is the value in SP? Stack 7FFO: DO (00000123) ----------SP 7FF4: D1 (120008A7) 7FF8: A1 (500600000) 7FFC: 00000422 (MOVE.B D1, DO) 8000 Question 5 What is the word value in (SP)? 7FFO: 0000 7FF2:0123 Therefore, (SP) is 0000 Question 6 After exit MOVEML (SP)-DO-D1 A1 has called. What is the long word value in (SP)? Stack 7FFO: DO (00000123) pop 7FF4: D1 (120008A7) --- pop 7FF8: A1 (500600000) --------pop 7FFC: 00000422 MOVE.B D1, DO) SP 8000: Therefore 0000422 Stack and subroutine Refer the following code snippet ORG $400 420 422 JSR MOVE.B checksum D1, DO Subroutine: CHECKSUM (starting address: $482) * * ****************************** ZERO BOU 0000 482 checksum MOVEM. L A1/DO-D1,-(SP) 486 LEA $4000, A1 500 exit MOVEML (SP) +,DO-D1/A1 504 RTS Before go to the subroutine, suppose that the SP currently has a value $8000 DO has $00000123, D1 has $120008A7, A1 has 500600000 Suppose checksum MOVEML AIDO-D1.-(SP) has called Answer the following: What is the value in SP? Stack 7FFO: DO (00000123) ----------SP 7FF4: D1 (120008A7) 7FF8: A1 (500600000) 7FFC: 00000422 (MOVE.B D1, DO) 8000 Question 5 What is the word value in (SP)? 7FFO: 0000 7FF2:0123 Therefore, (SP) is 0000 Question 6 After exit MOVEML (SP)-DO-D1 A1 has called. What is the long word value in (SP)? Stack 7FFO: DO (00000123) pop 7FF4: D1 (120008A7) --- pop 7FF8: A1 (500600000) --------pop 7FFC: 00000422 MOVE.B D1, DO) SP 8000: Therefore 0000422

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

Database Concepts

Authors: David M Kroenke, David J Auer

6th Edition

0132742926, 978-0132742924

More Books

Students also viewed these Databases questions