35.3.1.4. INTEGER ARITHMETICAL ON MIPS
+------------------------------+
| Len Value
| 6 0
| 5 rs
| 5 rt
| 5 rd
| 5 0
| 5 xx
+------------------------------+
Command xx
ADD rd,rs,rt 10 0000 Add
ADDU rd,rs,rt 10 0001 Add Unsigned
DADD rd,rs,rt 10 1100 Doubleword Add
DADDU rd,rs,rt 10 1101 Doubleword Add Unsigned
rd <- rs + rt
DDIV rs,rt 01 1110 Doubleword Divide Signed
DDIVU rs,rt 01 1111 Doubleword Divide Unsigned
DIV rs,rt 01 1010 Divide Signed Word
DIVU rs,rt 01 1011 Divide Unsigned Word
{in opcode rd = 0}
(LO,HI) <- rs / rt (LO - div, HI - mod)
DMULT rs,rt 01 1100 Doubleword Signed Multiply
DMULTU rs,rt 01 1101 Doubleword Unsigned Multiply
MULT rs,rt 01 1000 Multiply Word Signed
MULTU rs,rt 01 1001 Multiply Word Unsigned
{in opcode rd = 0}
(LO,HI) <- rs * rt
SUB rd,rs,rt 10 0010 Subtract word
SUBU rd,rs,rt 10 0011 Subtract unsigned word
DSUB rd,rs,rt 10 1110 Doubleword subtract
DSUBU rd,rs,rt 10 1111 Doubleword subtract unsigned
rd <- rs - rt
+------------------------+
| Len Value |
| 6 00 1000 |
| 5 rs |
| 5 rt |
| 16 immm |
+------------------------+
ADDI rt,rs,imm 00 1000 Add Immediate Signed
ADDIU rt,rs,imm 00 1001 Add Immediate Unsigned
DADDI rt,rs,imm 01 1000 Add Doubleword immediate signed
DADDIU rt,rs,imm 01 1001 Addd Doubleword immediate unsigned
rt <- rs + imm
NOTE
Use MFHI and MFLO operations for Load Data from LO,HI registers
// ----------------------------------------------------------------------
Index Prev Next