private static bool P(uint u, Tms7000Disassembler dasm) { if (!dasm.rdr.TryReadByte(out byte b)) { return(false); } dasm.ops.Add(new RegisterOperand(dasm.arch.Ports[b])); return(true); }
private static bool DB(uint b, Tms7000Disassembler dasm) { if (!dasm.rdr.TryReadBeUInt16(out ushort w)) { return(false); } dasm.ops.Add(MemoryOperand.Indexed(Address.Ptr16(w), dasm.arch.b)); return(true); }
// indirect private static bool Indirect(uint u, Tms7000Disassembler dasm) { if (!dasm.rdr.TryReadByte(out byte b)) { return(false); } dasm.ops.Add(MemoryOperand.Indirect(dasm.arch.GpRegs[b])); return(true); }
// short PC-relative jump private static bool j(uint u, Tms7000Disassembler dasm) { if (!dasm.rdr.TryReadByte(out byte b)) { return(false); } dasm.ops.Add(AddressOperand.Create(dasm.rdr.Address + (sbyte)b)); return(true); }
private static bool I(uint b, Tms7000Disassembler dasm) { if (!dasm.rdr.TryReadBeUInt16(out ushort w)) { return(false); } dasm.ops.Add(ImmediateOperand.Word16(w)); return(true); }
private static bool i(uint u, Tms7000Disassembler dasm) { if (!dasm.rdr.TryReadByte(out byte b)) { return(false); } dasm.ops.Add(ImmediateOperand.Byte(b)); return(true); }
public override Tms7000Instruction Decode(uint b, Tms7000Disassembler dasm) { foreach (var m in mutators) { if (!m(b, dasm)) { return(dasm.CreateInvalidInstruction()); } } var instr = new Tms7000Instruction { Mnemonic = opcode, InstructionClass = iclass, Operands = dasm.ops.ToArray() }; return(instr); }
public Tms7000Instruction Decode(byte b, Tms7000Disassembler dasm) { foreach (var m in mutators) { if (!m(b, dasm)) { return(Invalid()); } } var instr = new Tms7000Instruction { Opcode = opcode, InstructionClass = iclass, 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, }; return(instr); }
private static bool S(uint b, Tms7000Disassembler dasm) { dasm.ops.Add(new RegisterOperand(dasm.arch.st)); return(true); }