Beispiel #1
0
        internal override MipsInstruction Decode(uint wInstr, MipsDisassembler dasm)
        {
            var instr = base.Decode(wInstr, dasm);
            var imm   = instr.op3 as ImmediateOperand;

            if (imm != null && imm.Value.IsIntegerZero)
            {
                return new MipsInstruction {
                           Address = instr.Address,
                           Length  = instr.Length,
                           opcode  = Opcode.nop
                }
            }
            ;
            else
            {
                return(instr);
            }
        }
Beispiel #2
0
 public override MipsInstruction Decode(uint wInstr, MipsDisassembler dasm)
 {
     foreach (var m in mutators)
     {
         if (!m(wInstr, dasm))
         {
             return(new MipsInstruction
             {
                 InstructionClass = InstrClass.Invalid,
                 Mnemonic = Mnemonic.illegal
             });
         }
     }
     return(new MipsInstruction
     {
         Mnemonic = mnemonic,
         InstructionClass = iclass,
         Address = dasm.addr,
         Length = 4,
         Operands = dasm.ops.ToArray()
     });
 }
Beispiel #3
0
 internal override MipsInstruction Decode(uint wInstr, MipsDisassembler dasm)
 {
     foreach (var m in mutators)
     {
         if (!m(wInstr, dasm))
         {
             return(new MipsInstruction
             {
                 iclass = InstrClass.Invalid,
                 opcode = Opcode.illegal
             });
         }
     }
     return(new MipsInstruction
     {
         opcode = opcode,
         iclass = iclass,
         Address = dasm.addr,
         Length = 4,
         op1 = dasm.ops.Count > 0 ? dasm.ops[0] : null,
         op2 = dasm.ops.Count > 1 ? dasm.ops[1] : null,
         op3 = dasm.ops.Count > 2 ? dasm.ops[2] : null,
     });
 }
Beispiel #4
0
 internal override MipsInstruction Decode(uint wInstr, MipsDisassembler dasm)
 {
     return(dasm.DecodeOperands(opcode, wInstr, format));
 }
Beispiel #5
0
        internal override MipsInstruction Decode(uint wInstr, MipsDisassembler dasm)
        {
            var opcode = ((wInstr & (1u << 16)) != 0) ? opTrue : opFalse;

            return(dasm.DecodeOperands(opcode, wInstr, "c18,j"));
        }
Beispiel #6
0
 internal override MipsInstruction Decode(uint wInstr, MipsDisassembler dasm)
 {
     return(oprecs[wInstr & 0x3F].Decode(wInstr, dasm));
 }
Beispiel #7
0
 internal abstract MipsInstruction Decode(uint wInstr, MipsDisassembler dasm);
Beispiel #8
0
        internal override MipsInstruction Decode(uint wInstr, MipsDisassembler dasm)
        {
            var opcode = opcodes[(wInstr >> 16) & 0x1F];

            return(dasm.DecodeOperands(opcode, wInstr, "R1,j"));
        }
Beispiel #9
0
            public override MipsInstruction Decode(uint wInstr, MipsDisassembler dasm)
            {
                var decoder = ((wInstr & (1u << 16)) != 0) ? opTrue : opFalse;

                return(decoder.Decode(wInstr, dasm));
            }
Beispiel #10
0
        internal override MipsInstruction Decode(uint wInstr, MipsDisassembler dasm)
        {
            var opcode = ((wInstr & (1u << 16)) != 0) ? opTrue : opFalse;

            return(dasm.DecodeOperands(wInstr, opcode, InstrClass.ConditionalTransfer | InstrClass.Delay, "c18,j"));
        }
Beispiel #11
0
        internal override MipsInstruction Decode(uint wInstr, MipsDisassembler dasm)
        {
            var decoder = decoders[(wInstr >> 16) & 0x1F];

            return(decoder.Decode(wInstr, dasm));
        }
Beispiel #12
0
        internal override MipsInstruction Decode(uint wInstr, MipsDisassembler dasm)
        {
            int iDecoder = (int)((wInstr >> shift) & mask);

            return(decoders[iDecoder].Decode(wInstr, dasm));
        }