Pergunta

I've decode the three MIPS registries under here, but I'm not sure if I'm applying the theory correctly. Could someone confirm my answers and perhaps shed some light on decoding the first address?

0010 34422345 ori $2 , $2 ,0 x2345

0018 24020007 li $2 ,7  

002c 00621021 addu $2 , $3 , $2

1st = opcode: 13; rs: 18; rt: 18;

2nd = I-type: opcode 8; rs 18; adress 7;

3rd = R-type: opcode 0; rs 18; rt 19; rd 18;

Foi útil?

Solução

Your numbers look a bit off. These are my interpretations:

1) I-type

0x34422345
001101    00010     00010      0010001101000101  (binary)
 op (13)    rs (2)   rt (2)       imm (0x2345)

=> ori $v0,$v0,0x2345

2) I-type

0x24020007
001001        00000    00010    0000000000000111
 op (9=addiu)  rs (0)   rt (2)    imm (7)

=> addiu $v0,$zero,7

3) R-type

0x00621021
000000   00011   00010    00010    00000     100001
 op (0)   rs (3)  rt (2)   rd (2)   shift   function (33)

=> addu $v0,$v1,$v0

Here's a list of opcode/function numbers.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top