Computer architectures
[MIPS] Format instruction identification
YEJI ⍢
2022. 10. 10. 16:11
728x90
OP code
Function code
Instruction format
↑↑↑ 위에 표들을 참고해서 문제를 푸시면 됩니다 ↑↑↑
Loop: add $t1, $s3, $s3
add $t1, $t1, $t1
add $t1, $s3, $s6
lw $t0, 0($t1)
bne $t0, $s5, Exit
add $s3, #s3, #s4
j Loop
Exit:
Q1) add $t1, $s3, $s3
0 | 19 | 19 | 9 | 0 | 32 |
Binary: 000000 10011 10011 01001 00000 100000
Hexadecimal: 0x02734820
Q2) add $t1, $st1, $t1
0 | 9 | 9 | 9 | 0 | 32 |
Q3) add $t1, $t1, $s6
0 | 9 | 22 | 9 | 0 | 32 |
Q4) lw $t0, 0($t1)
35 | 9 | 8 | 0 (constant) |
Q5) bne $t0, $s5, Exit
5 | 8 | 21 | 8 → 2 |
Q6) j Loop
2 | ? |
◡̈