Question

Assume the memory display of the HCS12 shows 16 bytes starting at S0800 as follows SOBO0 80 53 05 28 36 89 00 FF FE 80 91 3E
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer :- 5) In HCS12, when a byte is pushed in to the stack, the stack pointer value decreases first by 1 and the value is kept at that memory.

When a byte value is pulled, the current SP memory value is returned ans SP = SP + 1.

The value of registers are shown below-

Assume the memory display of the HCS12 shows 16 bytes starting at 50800 as follows SOBO0: 80 53 05 28 36 89 00 FF FE 80 91 3E

Answer :- 6) The given program stores the value in B register to the memory address $0800. This is done for 5 times. The count value 5 is present in register A. After storing the value-

  1. The memory address present in X register is incremented by one.
  2. The value present in B register is incremented by one.
  3. The count value in A is decremented by 1 and if this is not zero then again the value in B register is copied to next memory address in X register.

Thus five bytes of data is being copied to memory. The memory and data values are-

$0800 = 0xFF = 255, count value in A = 5
$0801 = 0x00 = 0, count value in A = 4
$0802 = 0x01 = 1, count value in A = 3
$0803 = 0x02 = 2, count value in A = 2
$0804 = 0x03 = 3, count value in A = 1

When A = 0, the loop ends and program is finished.

Add a comment
Know the answer?
Add Answer to:
Assume the memory display of the HCS12 shows 16 bytes starting at S0800 as follows SOBO0...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT