I was a hard time to complete these two exercise problem. The HCS12 Microcontrol
ID: 3869623 • Letter: I
Question
I was a hard time to complete these two exercise problem. The HCS12 Microcontrollers and Embedded Systems, 1st Edition and codewarrior, I was not able to use it to solve this problem. I need help to solve this problem and due today? Thank you
Assume SP = $4000, and A = $FE, after executing PSHA:
SP = $4001, A = $FE, and M[$4000] = $FE
SP = $3FFF, A = $FE, and M[$4000] = $FE
SP = $3FFD, A = $FE, and M[$3FFF] = $FE
SP = $3FFF, A = $FE, and M[$3FFF] = $FE
Assume SP = $3FFA, M[$3FFA] = $55, after executing PULA:
SP = $3FF9, M[$3FFA] = $55, and A = $55
SP = $3FFB, M[$3FFA] = $55, and A = $55
SP = $3FFB, M[$3FFB] = $55, and A = $FA
SP = $3FFC, M[$3FFB] = $FB, and A = $FB
Explanation / Answer
PSHA -> push accumulator onto the stack.
So after executing PSHA, the A value is stored into accumulator.
So M[$4000] = SFE
and stack pointer moves to one position that is SP = $4001
So finally,
---------------------------------------------------------------------------------------------------------------------------------------------------------
PULA means pulling accumulator from accumulator..
It pulls acculumator M[$3FFA] = $55,, which is $55 into A
And stack pointer increases by 1. So Sp = 3FFA + 1 ===> 3FFB
So ,
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.