Ejemplo n.º 1
0
        /// <summary>
        /// Conditional operand in the next-to-lowest nybble.
        /// </summary>
        private static bool c4(uint uInstr, C166Disassembler dasm)
        {
            var c = (CondCode)((uInstr >> 4) & 0xF);

            dasm.ops.Add(new ConditionalOperand(c));
            return(true);
        }
Ejemplo n.º 2
0
        private static bool rel(uint uInstr, C166Disassembler dasm)
        {
            var offset = relField.ReadSigned(uInstr) << 1;
            var addr   = dasm.rdr.Address + offset;

            dasm.ops.Add(AddressOperand.Create(addr));
            return(true);
        }
Ejemplo n.º 3
0
 public override C166Instruction Decode(uint wInstr, C166Disassembler dasm)
 {
     if (!dasm.rdr.TryReadLeUInt16(out ushort uHigh))
     {
         return(dasm.CreateInvalidInstruction());
     }
     wInstr |= ((uint)uHigh) << 16;
     return(nextDecoder.Decode(wInstr, dasm));
 }
Ejemplo n.º 4
0
 private static bool trapNo(uint uInstr, C166Disassembler dasm)
 {
     if ((uInstr & 0x100) != 0)
     {
         return(false);
     }
     dasm.ops.Add(ImmediateOperand.Byte((byte)(uInstr >> 9)));
     return(true);
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Direct 16-bit jump address.
 /// </summary>
 private static bool caddr(uint uInstr, C166Disassembler dasm)
 {
     if (!dasm.rdr.TryReadLeUInt16(out ushort uAddr))
     {
         return(false);
     }
     dasm.ops.Add(AddressOperand.Ptr16(uAddr));
     return(true);
 }
Ejemplo n.º 6
0
 private static bool data16(uint uInstr, C166Disassembler dasm)
 {
     if (!dasm.rdr.TryReadLeUInt16(out ushort data))
     {
         return(false);
     }
     dasm.ops.Add(ImmediateOperand.Word16(data));
     return(true);
 }
Ejemplo n.º 7
0
        private static bool pageNo(uint uInstr, C166Disassembler dasm)
        {
            if ((uInstr & 0x100) != 0)
            {
                return(false);
            }
            var page = ImmediateOperand.Word16((ushort)Bits.ZeroExtend(uInstr >> 16, 10));

            dasm.ops.Add(page);
            return(true);
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Register referred to twice in the high byte of the opcode.
        /// </summary>
        private static bool nn(uint uInstr, C166Disassembler dasm)
        {
            var regs = Registers.GpRegs;
            var nReg = Bits.ZeroExtend(uInstr >> 12, 4);
            var mReg = Bits.ZeroExtend(uInstr >> 8, 4);

            if (nReg != mReg)
            {
                return(false);
            }
            dasm.ops.Add(new RegisterOperand(regs[nReg]));
            return(true);
        }
Ejemplo n.º 9
0
 /// <summary>
 /// Segment descriptor encoded in high byte of instruction.
 /// </summary>
 private static bool seg(uint uInstr, C166Disassembler dasm)
 {
     dasm.ops.Add(ImmediateOperand.Byte((byte)(uInstr >> 8)));
     return(true);
 }
Ejemplo n.º 10
0
 private static bool data2_12(uint uInstr, C166Disassembler dasm)
 {
     dasm.ops.Add(ImmediateOperand.Byte((byte)((uInstr >> 12) & 0b11)));
     return(true);
 }