Operands assigned in this order, masked against the global OP_MASK (0 is enabled): MULT1 OP_MASK.b4 MULT2 OP_MASK.b3 ALU1 OP_MASK.b2 ALU2 OP_MASK.b1 BS OP_MASK.b0 If no extra operands exist, the writeback EA is always WritebackEA. If extra operands _do_ exist, and WritebackEA is not assigned (or assigned to zero), LastEA is used as writeback EA. In dsp_insns.txt, these are assigned to numbers in order; that is, Oper0 is the first Op0. ------------------------------------------------------------------------------- OP & 0x8000 == 0x0000: 15 14 13 10 9 8 5 4 3 0 |...|Op0Indir|Op0 |Op1Indir|Op1|Op2Indir|Op2| LastEA = Op2EA Op0: Op0EA = Op0Indir ? IMEM[REGADDR[Op0]] : REGADDR[Op0] Op0Value = IMEM[Op0EA] Op1: Op1EA = Op1Indir ? IMEM[REGADDR[Op1]] : REGADDR[Op1] Op1Value = IMEM[Op1EA] Op2: Op2EA = Op2Indir ? IMEM[REGADDR[Op2]] : REGADDR[Op2] Op2Value = IMEM[Op2EA] ------------------------------------------------------------------------------- OP & 0xE000 == 0x8000: 15 13 12 11 10 9 0 |... |--|Writeback|Indirect|Address| LastEA = Op0EA if(Writeback) WritebackEA = Op0EA Op0: Op0EA = Indirect ? IMEM[Address] : Address Op0Value = IMEM[Op0EA] ------------------------------------------------------------------------------- OP & 0xE000 == 0xA000: 15 13 12 11 10 9 8 5 4 3 0 |... |Writeback0|Writeback1|UseOp0|Op0Indir|Op0|Op1Indir|Op1| if(UseOp0) { if(Writeback0) WritebackEA = Op0EA Op0: Op0EA = Op0Indir ? IMEM[REGADDR[Op0]] : REGADDR[Op0] Op0Value = IMEM[Op0EA] }else{ Op1 is actually Op0, and there is no Op0 } LastEA = Op1EA if(Writeback1) WritebackEA = Op1EA Op1: Op1EA = Op1Indir ? IMEM[REGADDR[Op1]] : REGADDR[Op1] Op1Value = IMEM[Op1EA] ------------------------------------------------------------------------------- OP & 0xC000 == 0xC000: 15 14 13 12 0 |... |Shift|Value| LastEA = Op0Value Op0: Op0Value = Value << (Shift ? 3 : 0) =============================================================================== Public domain 3DO chip documentation, by trap15 Last update 2020-05-09T20:10+09 Knowledge derived from FreeDO source. FreeDO Project authors: Alexander Troosh Maxim Grishin Allen Wright John Sammons Felix Lazarev