public InvOpRec(Opcode opcode, string fmt) { this.opcode = opcode; this.fmt = fmt; }
private Tlcs900Instruction Decode(byte b, Opcode opcode, string fmt) { var instr = new Tlcs900Instruction { Opcode = opcode, Address = this.addr, }; var ops = new List <MachineOperand>(); MachineOperand op = null; for (int i = 0; i < fmt.Length; ++i) { switch (fmt[i++]) { case ',': continue; case 'C': // condition code var cc = (CondCode)(b & 0xF); if (cc == CondCode.T) { continue; } op = new ConditionOperand(cc); break; case 'A': op = new RegisterOperand(Tlcs900Registers.a); break; case '3': // Immediate encoded in low 3 bits var c = Constant.Create(Size(fmt[1]), imm3Const[b & 7]); SetSize(fmt[1]); op = new ImmediateOperand(c); break; case 'I': // immediate op = Immediate(fmt[i++]); break; case 'j': // Relative jump switch (fmt[i++]) { case 'b': byte o8; if (!rdr.TryReadByte(out o8)) { op = null; } else { op = AddressOperand.Create(rdr.Address + (sbyte)o8); } break; case 'w': short o16; if (!rdr.TryReadLeInt16(out o16)) { op = null; } else { op = AddressOperand.Create(rdr.Address + o16); } break; } break; case 'J': // Absolute jump switch (fmt[i++]) { case 'w': op = AbsoluteDestination(2); break; case 'l': op = AbsoluteDestination(3); break; default: op = null; break; } break; case 'R': // 16 bit register encoded in lsb op = new RegisterOperand(Reg(fmt[i++], b & 0x7)); break; case 'S': // status/flag register op = StatusRegister(fmt[i++]); break; } if (op == null) { return(Decode(b, Opcode.invalid, "")); } ops.Add(op); } if (ops.Count > 0) { instr.op1 = ops[0]; if (ops.Count > 1) { instr.op2 = ops[1]; if (ops.Count > 2) { instr.op3 = ops[2]; } } } return(instr); }
public OpRec(Opcode opcode, InstrClass iclass, string fmt) { this.opcode = opcode; this.iclass = iclass; this.fmt = fmt; }
public SecondOpRec(Opcode opcode, string fmt) { this.opcode = opcode; this.fmt = fmt; }
public OpRec(Opcode opcode, string fmt) : this(opcode, InstrClass.Linear, fmt) { }
private static OpRec Instr(Opcode opcode, InstrClass iclass, params Mutator <Tlcs900Disassembler>[] mutators) { return(new OpRec(opcode, iclass, mutators)); }
public InvOpRec(Opcode opcode, params Mutator <Tlcs900Disassembler>[] mutators) { this.opcode = opcode; this.mutators = mutators; }
public SecondOpRec(Opcode opcode, Mutator <Tlcs900Disassembler> mutator = null) { this.opcode = opcode; this.mutator = mutator; }
public OpRec(Opcode opcode, InstrClass iclass, Mutator <Tlcs900Disassembler>[] mutators) { this.opcode = opcode; this.iclass = iclass; this.mutators = mutators; }