MIPS >> Opcode
MIPS IV
參考資訊:
1. mips-isa
opcode欄位對應如下:
bits 31 30 29 28 27 26 | 25 24 23 22 21 | 20 19 18 17 16 | 15 14 13 12 11 10 9 8 7 6 | 5 4 3 2 1 0 |
---|---|---|---|---|
opcode |
opcode | (bits 28..26) 000 | 001 | 010 | 011 | 100 | 101 | 110 | 111 |
---|---|---|---|---|---|---|---|---|
(bits 31..29) 000 | special | regimm | j | jal | beq | bne | blez | bgtz |
001 | addi | addiu | slti | sltiu | andi | ori | xori | lui |
010 | cop0 | cop1 | cop2 | cop1x | beql | bnel | blezl | bgtzl |
011 | daddi | daddiu | ldl | ldr | ||||
100 | lb | lh | lwl | lw | lbu | lhu | lwr | lwu |
101 | sb | sh | swl | sw | sdl | sdr | swr | |
110 | ll | lwc1 | lwc2 | pref | lld | ldc1 | ldc2 | ld |
111 | sc | swc1 | swc2 | scd | sdc1 | sdc2 | sd |
function欄位對應如下:
bits 31 30 29 28 27 26 | 25 24 23 22 21 | 20 19 18 17 16 | 15 14 13 12 11 10 9 8 7 6 | 5 4 3 2 1 0 |
---|---|---|---|---|
opcode=special | function |
function | (bits 2..0) 000 | 001 | 010 | 011 | 100 | 101 | 110 | 111 |
---|---|---|---|---|---|---|---|---|
(bits 5..3) 000 | sll | movci | srl | sra | sllv | srlv | srav | |
001 | jr | jalr | movz | movn | syscall | break | sync | |
010 | mfhi | mthi | mflo | mtlo | dsllv | dsrlv | dsrav | |
011 | mult | multu | div | divu | dmult | dmultu | ddiv | ddivu |
100 | add | addu | sub | subu | and | or | xor | nor |
101 | slt | sltu | dadd | daddu | dsub | dsubu | ||
110 | tge | tgeu | tlt | tltu | teq | tne | ||
111 | dsll | dsrl | dsra | dsll32 | dsrl32 | dsra32 |
rt欄位對應如下:
bits 31 30 29 28 27 26 | 25 24 23 22 21 | 20 19 18 17 16 | 15 14 13 12 11 10 9 8 7 6 | 5 4 3 2 1 0 |
---|---|---|---|---|
opcode=regimm | rt |
rt | (bits 18..16) 000 | 001 | 010 | 011 | 100 | 101 | 110 | 111 |
---|---|---|---|---|---|---|---|---|
(bits 20..19) 00 | bltz | bgez | bltzl | bgezl | ||||
01 | tgei | tgeiu | tlti | tltiu | teqi | tnei | ||
10 | bltzal | bgezal | bltzall | bgezall | ||||
11 |