Question

In: Computer Science

Represent following LEGv8 assembly instruction into machine code (use hexa decimal format). STUR X1, [X1, #8]

Represent following LEGv8 assembly instruction into machine code (use hexa decimal format).
STUR X1, [X1, #8]

Solutions

Expert Solution

Solution :

LEGv8 assembly instruction STUR X1,[X1,#8] have following format,

Opcode

address

Op2

Rn

Rt

11 bits

9 bits

2 bits

5 bits

5 bits

Where, Opcode = Operation Code, Address = constant offset from content of base register, Op2 = any other operand, Rn = Base register, Rt = Destination or source register

So for translation we need to write instruction in above format using equivalent binary form and then covert into hexadecimal format, Opcode for STUR is 1984

Opcode(11 bits)

Address(9 bits)

Op2(2 bits)

Rn(5 bits)

Rt(5 bits)

1984

8

0

1

1

Equivalent binary form of each field in required bits

11111000000

000001000

00

00001

0001

Now we are going to make group of 4 bits from above resulted binary string, 1111 1000 0000 0000 1000 0000 0010 0001two = F800802116 Therefore instruction STUR X1,[X1,#8] is converted to (F8008021)16 machine code.


Related Solutions

Represent following LEGv8 machine code into assembly instruction. 0x784302CD
Represent following LEGv8 machine code into assembly instruction. 0x784302CD
1.The machine code of LEGv8 instruction SUB X15,X16,X17 in hexadecimal is? 2.The LEGv8 assembly instruction assembled...
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
Translate these two LEGv8 assembly instructions to 32-bit binary machine code. Give your answer in hexadecimal....
Translate these two LEGv8 assembly instructions to 32-bit binary machine code. Give your answer in hexadecimal. CBZ X19, exit ADD X10, X19, X20 exit:
Write assembly code for the following machine code. Assume that the segment is placed starting at...
Write assembly code for the following machine code. Assume that the segment is placed starting at location 80000. Create labels for jump and branch instructions. Indicate the actual memory addresses represented by such labels. 0010 1010 0000 1000 0000 0000 0000 1010 0001 0001 0000 0000 0000 0000 0000 0010 0000 0010 0001 0001 1000 0000 0010 0000 0000 1000 0000 0000 0100 1110 0010 0101 0000 0010 0001 0010 1000 0000 0010 0000
a. Write machine code for the following assembly code. Assume that the segment is placed starting...
a. Write machine code for the following assembly code. Assume that the segment is placed starting at location 80000. Use decimal numbers to represent each instruction. loop:         beq $s3, $s1, endwhile                  add $t0, $s3, $s4                  lw $t1, 0($t0)                  add $s0, $s0, $t1                  addi $s3, $s3, 4                  j loop endwhile: b. Write assembly code for the following machine code. Assume that the segment is placed starting at location 80000. Create labels for jump and branch instructions. Indicate the actual...
6 – Assuming single precision IEEE 754 format, what decimal number is represent by the following...
6 – Assuming single precision IEEE 754 format, what decimal number is represent by the following 32-bit binary word? 1 10001000 10010000000000000000000
Question: In the following MIPS assembly code, translate all the instructions to their corresponding machine code...
Question: In the following MIPS assembly code, translate all the instructions to their corresponding machine code in hexadecimal format. This code is stored in the memory from address 0x2fff0004. Loop: lw $t0, 4($s0)             addi $t1, $t1, -15             sll $t1, $t1, 2             beq $t1, $s1, Exit             addi $s0, $s0, 4             j Loop Exit: …
True and False 1. The instruction register stores machine code for the instruction being executed. 2....
True and False 1. The instruction register stores machine code for the instruction being executed. 2. Before a digital computer may execute an instruction, the instruction code must be fetched from memory. 3. A pointer is a binary code for data in the arithmetic logic unit. 4. Von Neumann computer architecture stores data and instruction codes in the same memory. 5. Complex instruction set computers have instructions with greater speed than those in reduced instruction set computers.
Encode the following instruction (1) identify the instruction format that will be used (2) indicate the...
Encode the following instruction (1) identify the instruction format that will be used (2) indicate the values of each of the fields for that format in decimal (3) convert each of these decimal val- ues to binary (4) represent the entire instruction as one hexadecimal value j L2. # where L2 is at the decimal byte address 1,048,608
Encode the following instruction opcode: 100011 (1) identify the instruction format that will be used (2)...
Encode the following instruction opcode: 100011 (1) identify the instruction format that will be used (2) indicate the values of each of the fields for that format in decimal (3) convert each of these decimal values to binary (4) represent the entire instruction as one hexadecimal value. subu $t3,$v1,$s2
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT