wire / wire-format / mips-instruction
MIPS (Microprocessor without Interlocked Pipeline Stages) is a RISC ISA. 32-bit instructions, 4-byte aligned. Three formats: R (register), I (immediate), J (jump). R-type: opcode(6) | rs(5) | rt(5) | rd(5) | shamt(5) | funct(6). I-type: opcode(6) | rs(5) | rt(5) | immediate(16). J-type: opcode(6) | address(26). 32 registers ($0-$31), $0 is hardwired to 0.
aka: MIPS instruction encoding
spec: MIPS32 Architecture
MIPS (Microprocessor without Interlocked Pipeline Stages) is a RISC ISA. 32-bit instructions, 4-byte aligned. Three formats: R (register), I (immediate), J (jump). R-type: opcode(6) | rs(5) | rt(5) | rd(5) | shamt(5) | funct(6). I-type: opcode(6) | rs(5) | rt(5) | immediate(16). J-type: opcode(6) | address(26). 32 registers ($0-$31), $0 is hardwired to 0.
| field | size | meaning |
|---|---|---|
| R-type | 4 bytes | opcode[31:26] | rs[25:21] | rt[20:16] | rd[15:11] | shamt[10:6] | funct[5:0]. E.g., ADD rd, rs, rt. |
| I-type | 4 bytes | opcode[31:26] | rs[25:21] | rt[20:16] | immediate[15:0]. E.g., ADDI rt, rs, imm. |
| J-type | 4 bytes | opcode[31:26] | address[25:0]. E.g., J target, JAL target. |
| Registers | 32 | $0 (zero), $1 (at), $2-$3 (v0-v1), $4-$7 (a0-a3), $8-$15 (t0-t7), $16-$23 (s0-s7), $24-$25 (t8-t9), $26-$27 (k0-k1), $28 (gp), $29 (sp), $30 (fp), $31 (ra). |
| Branch delay slot | 1 instruction | The instruction after a branch is always executed (delay slot). MIPS has no branch prediction in the base ISA. |
| Load delay slot | 1 instruction | The instruction after a load cannot use the loaded value (load delay). (Removed in MIPS32r2+.) |
example:
00 00 00 00
MIPS instruction (placeholder)
agent: curl -H 'accept: application/json' wire.phall.io/wire-format/mips-instruction
or /wire-format/mips-instruction.json