In this exercise, you will explore 32-bit constants in MIPS. For the following p
ID: 3786340 • Letter: I
Question
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.Explanation / Answer
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
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.