Please use MIPS Assembly language program code to fill in the spaces in the tabl
ID: 3871070 • Letter: P
Question
Please use MIPS Assembly language program code to fill in the spaces in the table below.First one has been filed as example
Please fill in the spaces in the table as my example shows: Please use decimal values for the OpCode row, and Hex digits for the Instruction rows Use your Green Card to lookup the required values. Location Program Counter Counter # $t4 = $56 + $s1 12 Opcode Rs 0 32 22 17 Rd 12 Rt Immediate field 000000 10110 10001 01100 00000 100000 32 02D1 6020 36 Additionally, use the Left margin to keep track of the Location Counter, and the right margin to note the value that would be in the Program Counter The initial value of the Location Counter should be zero. The first instruction below is worked.Explanation / Answer
LW $t1, 0, ($a0)
Syntax: LW base, targetRegister offset
Here base is: $a0 (00100)
targetRegister is: $t1 (01001)
And obviously offset is 0 (0000000000000000)
LW instruction code is: 100011
And the binary equivalent is:
100011 00100 01001 0000000000000000
And its hexadecimal equivalent is:
1000 1100 1000 1001 0000 0000 0000 0000
8 C 8 9 0 0 0 0
So, the hex code is: 8C89 0000
ADDI $v0, $v0, 1
Syntax: ADDI target, source, immediate
source and target are both: 00010
And immediate is: 0000000000000001
ADDI instruction is: 001000
And the binary equivalent is:
001000 00010 00010 0000000000000001
And its hexadecimal equivalent is:
0010 0000 0100 0010 0000 0000 0000 0001
2 0 4 2 0 0 0 1
So, the hex code is: 2042 0001
SW $t1, 0, ($a1)
Syntax: SW target, offset, base
target is: 01001
offset is: 0000000000000000
base is: 00101
SW: 101011
And the binary equivalent is:
101011 00101 01001 0000000000000000
And its hexadecimal equivalent is:
1010 1100 1010 1001 0000 0000 0000 0000
A C A 9 0 0 0 0
So, the hex code is: ACA9 0000
ADDI $a0, $a0, 4
Syntax is explained earlier:
source and target values: 00100
And the immediate equivalent is: 0000000000000100
So, the binary equivalent is:
001000 00100 00100 0000000000000100
And the binary equivalent is:
0010 0000 1000 0100 0000 0000 0000 0100
2 0 8 4 0 0 0 4
So, the hex code is: 2084 0004