public override Tlcs900Instruction Decode(byte b, Tlcs900Disassembler dasm) { if (!mutator(b, dasm) || !dasm.rdr.TryReadByte(out b)) { return(dasm.Invalid()); } return(memOpRecs[b].Decode(b, dasm)); }
public override Tlcs900Instruction Decode(byte b, Tlcs900Disassembler dasm) { if (!dasm.rdr.TryReadByte(out b)) { return(null); } dasm.opSize = width; var op = dasm.ExtraRegister(b); if (op == null) { return(dasm.Invalid()); } if (!dasm.rdr.TryReadByte(out b)) { return(dasm.Invalid()); } dasm.ops.Add(op); return(regOpRecs[b].Decode(b, dasm)); }
public override Tlcs900Instruction Decode(byte b, Tlcs900Disassembler dasm) { foreach (var m in mutators) { if (!m(b, dasm)) { return(dasm.Invalid()); } } bool swap = dasm.ops.Count == 2; return(new Tlcs900Instruction { Opcode = this.opcode, Address = dasm.addr, op1 = swap ? dasm.ops[1] : dasm.ops[0], op2 = swap ? dasm.ops[0] : null }); }
public override Tlcs900Instruction Decode(byte b, Tlcs900Disassembler dasm) { if (!mutator(b, dasm) || !dasm.rdr.TryReadByte(out b)) { return(dasm.Invalid()); } var instr = dstOpRecs[b].Decode(b, dasm); if (instr.op1 != null && instr.op2 != null) { instr.op1.Width = instr.op2.Width; } if (instr.op2 != null && instr.op2.Width == null) { //$HACK to get conditional calls/jumps to work instr.op2.Width = PrimitiveType.Word32; } return(instr); }
public override Tlcs900Instruction Decode(byte b, Tlcs900Disassembler dasm) { if (this.mutator == null) { return(new Tlcs900Instruction { Opcode = this.opcode, Address = dasm.addr, op1 = dasm.ops[0] }); } if (!mutator(b, dasm)) { return(dasm.Invalid()); } return(new Tlcs900Instruction { Opcode = this.opcode, Address = dasm.addr, op1 = dasm.ops.Count > 1 ? dasm.ops[1] : dasm.ops[0], op2 = dasm.ops.Count > 1 ? dasm.ops[0] : null, }); }