Question

Please add some explanation if possible 1.The machine code of LEGv8 instruction SUB X15,X16,X17 in hexadecimal...

Please add some explanation if possible

1.The machine code of LEGv8 instruction SUB X15,X16,X17 in hexadecimal is?

2.The LEGv8 assembly instruction assembled into the hexadecimal machine code D1001695 is?

3.What does the LEGv8 instruction below do?

LSL X12,X12,#8

4. Which LEGv8 instruction set X12 to be X10's one's complement?

(Assume X9 contains hexadecimal FFFFFFFF.)

5. What is the minimum number of LEGv8 assembly instructions needed to perform the following task?

A[20] = A[10] + b + c - 8

Homework Answers

Answer #1

(1)SUB x15, x16, x17
R-format instruction
opcode = 11001011000
Rm = 17 = 10001
shamt = 0 =000000
Rn = 16 = 10000
Rd = 15 = 01111

11001011000 10001 000000 10000 01111
In hexadecimal = 0xCB11020F

(2)D1001695
1101000100 000000000101 10100 10101
opcode = 1101000100 (SUBI)
immediate value = 000000000101 (5)
Rn = 10100 (20)
Rd = 10101 (21)

SUBI x21, x20, 5

(3)LSL X12,X12,#8
Left shift logically content of register x12 by 8 bit.
X12 = (X12 << 8)
equivalent to X12 = x12 *(2^8)
x12 = x12 * 256

(4) EOR X12, X10, X9
Xor content of register X10 with X9 and store result in register X12

(5)A[20] = A[10] + b + c - 8
2 memory access instructions ( 1 for Load and 1 for store)
and 3 Arithmetic instructions(2 for add and 1 for subtract)
minimum number of instruction needed = 5

Know the answer?
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
Similar Questions
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT