In this exercise you will explore 32bit constants in MIPS Fo

In this exercise, you will explore 32-bit constants in MIPS. For the following problems, you will be using the binary data in the table below: 1010 1101 0001 0000 0000 0000 0000 0010 1111 1111 1111 1111 1111 1111 1111 1111 Write the MIPS code that creates the 32-bit constants listed above and stores that value to register $t1 If the current value of the PC is 0x00000000, can you use a single jump instruction to get to the PC address as shown in the table above? If the current value of the PC is 0x00000600, can you use a single jump instruction to get to the PC address as shown in the table above? If the current value of the PC is 0x00400600, can you use a single jump instruction to get to the PC address as shown in the table above? If the immediate field of a MIPS instruction was only 8 bits wide, write the MIPS code that creates a 32-bit constants listed above and stores that value to register $t1. Do not use the lui instruction.

Solution

1) a) 1010 1101 0001 0000 0000 0000 0000 0010

lui $t1, 0xad10 # $t1 = 1010 1101 0001 0000 0000 0000 0000 0000

ori $t1, 0x0002 # $t1 = 1010 1101 0001 0000 0000 0000 0000 0010

b)

lui $t1, 0xffff # $t1 = 1111 1111 1111 1111 0000 0000 0000 0000

ori $t1, 0xffff # $t1 = 1111 1111 1111 1111 1111 1111 1111 1111   

2) A single branch instruction cannot be used to pet the PC address in given table as the range can go upto 0x0ffffffc

 In this exercise, you will explore 32-bit constants in MIPS. For the following problems, you will be using the binary data in the table below: 1010 1101 0001 0

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site