Instructor. Hai Make Question 3 110+5- 15 points] Assume, PC $4000, x S2ABI, SP
ID: 3349689 • Letter: I
Question
Instructor. Hai Make Question 3 110+5- 15 points] Assume, PC $4000, x S2ABI, SP SABCD, Y -SACBF, D SEOFO and CCR- SFO a) Update stack, SP and PC register at the end of execution of each instruction of the provided code. SP= $ABCD Instruction ORG SC100 LDS #$FF00 PSHB PSHA PSHY PS?IX PC = $4000 MEMORY Address Data FEFE FEFF FF00 12 b) Assume that the following segment of the code is executed after code given in part (a). Update content of SP, A, B, X and Y registers at the end of execution of each instruction of the provided code segment Instruction | SP-S (use it from last instruction of art a) PSHX PSHA PSHYExplanation / Answer
A) INST SP PC
ORG $c100 &ABCD 4000
LDS #$FF00 &FF00 C104 : this inst is at c100 and 3-byte pc contain nxt instruct add so c104
PSHB &FEFE C105 :in psh operation stack is pre decremented by 2
PSHA &FEFC C106 :in psh operation stack is pre decremented by 2
PSHY &FEFA C107 :in psh operation stack is pre decremented by 2
PSHX &FEF8 C108 :in psh operation stack is pre decremented by 2
B) we need to update the content of stack, A,B,X,Y. But the operations is PSH so the contens of A,B,X,Y are unchanged and contains the intial values and only stack pointer is changed
INST SP
PSHX &FEF6
PSHA &FEF4
PSHY &FEF2
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.