Пример #1
0
        private static bool ISP_4(uint uInstr, MilStd1750Disassembler dasm)
        {
            var imm = bf4_4.Read(uInstr) + 1u;

            dasm.ops.Add(ImmediateOperand.Word16((ushort)imm));
            return(true);
        }
Пример #2
0
        private static bool N(uint uInstr, MilStd1750Disassembler dasm)
        {
            var n = (ushort)bf4_4.Read(uInstr);

            dasm.ops.Add(ImmediateOperand.Word16(n));
            return(true);
        }
Пример #3
0
        /// <summary>
        /// IC-relative
        /// </summary>
        private static bool ICR(uint uInstr, MilStd1750Disassembler dasm)
        {
            var disp    = bf0_8.ReadSigned(uInstr);
            var addrDst = dasm.addr + disp;

            dasm.ops.Add(AddressOperand.Create(addrDst));
            return(true);
        }
Пример #4
0
 /// <summary>
 /// 16-bit immedate following the instruction word.
 /// </summary>
 private static bool IM(uint uInstr, MilStd1750Disassembler dasm)
 {
     if (!dasm.rdr.TryReadUInt16(out ushort imm))
     {
         return(false);
     }
     dasm.ops.Add(ImmediateOperand.Word16(imm));
     return(true);
 }
Пример #5
0
        /// <summary>
        /// XIO command decoder
        /// </summary>
        private static bool Xio(uint uInstr, MilStd1750Disassembler dasm)
        {
            if (!dasm.rdr.TryReadBeUInt16(out ushort cmd))
            {
                return(false);
            }
            var ra = Registers.GpRegs[bf4_4.Read(uInstr)];

            switch (cmd >> 12)
            {
            case 0:
                dasm.mnemonic = Mnemonic.xio_po;
                dasm.ops.Add(new RegisterOperand(ra));
                dasm.ops.Add(ImmediateOperand.Word16((ushort)(cmd & 0x03FF)));
                return(true);

            case 0x4:
                switch (cmd)
                {
                case 0x4000:
                    dasm.mnemonic = Mnemonic.xio_co;
                    dasm.ops.Add(new RegisterOperand(ra));
                    return(true);

                case 0x4001:
                    dasm.mnemonic = Mnemonic.xio_clc;
                    return(true);
                }
                break;

            case 0xA:
                switch (cmd)
                {
                case 0xAD51:
                    // 'MQ': Seems to be legit, but can't find documentation for it.
                    dasm.mnemonic = Mnemonic.xio_unknown;
                    dasm.ops.Add(ImmediateOperand.UInt16(cmd));
                    return(true);
                }
                break;
            }
            var testGenSvc = dasm.arch.Services.GetService <ITestGenerationService>();

            testGenSvc?.ReportMissingDecoder("MS1750Dis", dasm.addr, dasm.rdr, $"xio {cmd:X4}");
            return(false);
        }
Пример #6
0
        /// <summary>
        /// Address or indexed address
        /// </summary>
        private static bool Ax(uint uInstr, MilStd1750Disassembler dasm)
        {
            if (!dasm.rdr.TryReadBeUInt16(out ushort imm))
            {
                return(false);
            }
            var ixReg = bf0_4.Read(uInstr);

            if (ixReg != 0)
            {
                var op = new ImmediateOperand(Constant.Create(PrimitiveType.Word16, imm));
                dasm.ops.Add(op);
                var xReg = Registers.GpRegs[ixReg];
                dasm.ops.Add(new RegisterOperand(xReg));
            }
            else
            {
                var op = AddressOperand.Ptr16(imm);
                dasm.ops.Add(op);
            }
            return(true);
        }
Пример #7
0
 private static bool Imm8(uint uInstr, MilStd1750Disassembler dasm)
 {
     dasm.ops.Add(ImmediateOperand.Word16((ushort)bf0_8.Read(uInstr)));
     return(true);
 }