Question

Anyone explain to (i), (ii)

How can we get the instruction words and R8=?[hex]?

(i) instruction words[hex] is 0x4508, and R8= 0xF002

How can I get that?

(ii) instruction words[hex] is 0x4548 and R8=0x0002

How can I get that?

Consider the following instructions given in the table below. For each instruction determine its length (in words), the instruction words (in hexadecimal), source operand addressing mode, and the content of register R7 after execution of each instruction. Fill in the empty cells in the table. The initial content of memory is given below. Initial value of registers R:5 R6, and R7 is as follows: R5-0xF002, R6-0xF0OA, R8 0xFF88. Assume the starting conditions are the same for each each gmeieon dise always start from intial conditions in memonyz stion (i.e., always start from initial conditions in memory) and given register values. The format of the first word of double-operand instructions is shown below. (Note: Op-code for MOV is 0100b) 5 14 131 1 10 9 8 76543 Op-code S-Reg AdBWAs D-Reg Instr. Address (P Instruction Instr.Instruction Word(s) Source Operand R8-? Addressing Mode Registeir Registeir Length HEX] words HEX] (i)0x1116MOV R5, R8 (ii)0x1116MOV.B R5, R8 (a)Ox1116MOV 4(R5), R8 0x4508 0x4548 0xF002 0x0002 (b)Ox1116MOVB 3(R5), R8 (c)Ox1116MOVB -3(R6), R8 (d)Ox1116MOV TONI, R8 (e)Ox1116MOVB EDE, R8 (f)Ox1116MOV &EDE, R8 (g)Ox1116MOVB @R5, R8 (h)Ox1116MOV @R5+, R8 (i) |0x1116 |MOV #45 R8 (j) | 0x1116 |MOV.B #45 R8

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

i) MOV R5, R8 -> R8 = R5

The source register is R5 and destination register is R8. Therefore the contents of source register R5 is moved to destination register R8. The initial value contained in register R5 is 0xF002. Therefore the destination register R8 will also have the same value that of register R5, that is 0xF002.

The first fout bits of instruction word denotes the opcode of the instruction. The opcode for MOV is 0100b(0x4 in Hexa).

The next four bits of instruction word denotes the register used by source operand. Here it is register R5. Therefore it is 0101b(0x5 in Hexa)

The next one bit is to define the addressing mode used by source operand. For register mode it is 0b.

The next one bit is to define whether it is word or byte access. For word access it is 0b.

The next two bits is to define the addressing mode used by destination operand. For register mode it is 00b.

The last four bits denotes the register used by destination operand. Here it is register R8. Therefore it is 1000b(0x8 in Hexa).

Therefore the instruction word for the instruction MOV R5, R8 is:

0100 0101 0000 1000 => 0x4508

ii) MOV.B R5, R8 -> R8(Lower byte) = R5(Lower byte) and clears the upper byte of R8

The source register is R5 and destination register is R8. Therefore the contents of lower byte of source register R5 is moved to destination register R8's lower byte. The upper byte of R8 is cleared. The initial value contained in register R5 is 0xF002. Therefore the lower byte of destination register R8 will also have the same value that of register R5 in lower byte, that is 0x02.

Therefore after moving the value in R8 is 0x0002, where upper byte is cleared.

The first fout bits of instruction word denotes the opcode of the instruction. The opcode for MOV is 0100b(0x4 in Hexa).

The next four bits of instruction word denotes the register used by source operand. Here it is register R5. Therefore it is 0101b(0x5 in Hexa)

The next one bit is to define the addressing mode used by source operand. For register mode it is 0b.

The next one bit is to define whether it is word or byte access. For byte access it is 1b.

The next two bits is to define the addressing mode used by destination operand. For register mode it is 00b.

The last four bits denotes the register used by destination operand. Here it is register R8. Therefore it is 1000b(0x8 in Hexa).

Therefore the instruction word for the instruction MOV R5, R8 is:

0100 0101 0100 1000 => 0x4548

Add a comment
Know the answer?
Add Answer to:
Anyone explain to (i), (ii) How can we get the instruction words and R8=?[hex]? (i) instruction...
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