Question

CONFIDENTIAL BEE4323 1718H/SETA 3. If the content of memories ($3010) 77 A1 B2 C3 3D 4F 44 55, obtain the new contents of memories when the following program is executed. LDX #$3010 BRSET 1,X 07, SCAN BSET 3.x $45 BCLR 4,X SB3 BRA EXIT BSET 5,X $66 BCLR 6,X SBB BRA EXIT SCAN EXIT (S3010) 16 points ICO2, PO2, C4]

0 0
Add a comment Improve this question Transcribed image text
Answer #1

ANSWER:

Instructions:

LDX: load value stored at given address

BRSET: Branch to given label if given mask bits are set in the operand

BSET: set bits in the operand given by the mask BCLR: clear bits in the operand given by the mask BRA: Branch always

When given sequence of instructions executed: LDX #S3010 // load base address of the given array

BRSET 1,X 07, SCAN // Check if first three LSBs(07 — 00000111) are set in X+1 i.e. B2, false BSET 3,X $45 // set bits in X+3(C311000011) given mask 01110110

01110110

11000011

01110110 => x+3 becomes 36                         00111010

BCLR 4, X $B3 // clear bits B3(10110011)

01100111 => xi-3 becomes 15                                     00011001

BCLR 4, X$B3 // clear bits B3(11000100)

00110011

11000100

00110011 => no change, all the bits in the mask are already 0 BRA EXIT // jump to exit

(S3010): 77 A1 B2 15 3D 4F 44 55

Add a comment
Know the answer?
Add Answer to:
CONFIDENTIAL BEE4323 1718H/SETA 3. If the content of memories ($3010) 77 A1 B2 C3 3D 4F...
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