The following LC-3 instructions execute starting from the point shown by the com
ID: 3712815 • Letter: T
Question
The following LC-3 instructions execute starting from the point shown by the comment. "Location D" in this problem refers to a location in memory that precedes the first instruction to be executed. E.g., if instruction "0010 001 111111110" is located in memory at address x3001, then "location D refers to address x3000. 1010 1011 1100 1101 ; this is location D start LC-3 execution here 0001 001 001 1 00110 0101 011 001 1 01111 end LC-3 execution here After the code reaches the end of the code (the last comment), what bits are held in R1? And in R3? And in memory location D? If you cannot know the bits held, explain why.Explanation / Answer
First instruction loads 0xABCD in R1.
Second adds 6 to R1 so R1=0xABD3.
Third and 15(0xF) to R1 and stores in R3 so R3 is 0x0003
Fourth instruction stores R3 in address referred to by 0x3000 ie in 0xABCD so 0x0003 is stored in 0xABCD
Bits are therefore:
R1=1010 1011 1110 0011
R3=0000 0000 0000 0011
Location D(0x3000)=1010 1011 1100 1101