示例#1
0
 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);
 }
示例#2
0
 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);
 }
示例#3
0
 // 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);
 }
示例#4
0
 // 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);
 }
示例#5
0
 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);
 }
示例#6
0
 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);
 }
示例#7
0
            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);
            }
示例#8
0
            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);
            }
示例#9
0
 private static bool S(uint b, Tms7000Disassembler dasm)
 {
     dasm.ops.Add(new RegisterOperand(dasm.arch.st));
     return(true);
 }