private ushort bitSet;          // MoveM

        public OperandFormatDecoder(M68kDisassembler dasm, int i)
        {
            this.dasm = dasm;
            this.opcode = dasm.instruction;
            this.i = i;
        }
Exemple #2
0
 private void BuildTest(Action<M68kAssembler> builder)
 {
     builder(asm);
     dasm = M68kDisassembler.Create68020(asm.GetImage().Image.CreateBeReader(asm.BaseAddress));
 }
Exemple #3
0
 private void BuildTest(Action<M68kAssembler> builder)
 {
     builder(asm);
     dasm = M68kDisassembler.Create68020(
         asm.GetImage().SegmentMap.Segments.Values.First().MemoryArea.CreateBeReader(asm.BaseAddress));
 }
Exemple #4
0
 private static bool EXT_INDEX_LONG(uint A)
 {
     return(M68kDisassembler.BIT_B(A));
 }
Exemple #5
0
 private static bool EXT_INDEX_AR(uint A)
 {
     return(M68kDisassembler.BIT_F(A));
 }
Exemple #6
0
 internal static bool EXT_FULL(uint A)
 {
     return(M68kDisassembler.BIT_8(A));
 }
Exemple #7
0
 private static bool EXT_INDEX_REGISTER_PRESENT(uint A)
 {
     return(!(M68kDisassembler.BIT_6(A)));
 }
Exemple #8
0
        private ushort bitSet;          // MoveM

        public OperandFormatDecoder(M68kDisassembler dasm, int i)
        {
            this.dasm   = dasm;
            this.opcode = dasm.uInstr;
            this.i      = i;
        }
Exemple #9
0
        private bool TryAddressRegisterIndirectWithIndex(PrimitiveType dataWidth, EndianImageReader rdr, out MachineOperand op)
        {
            if (!rdr.TryReadBeUInt16(out ushort extension))
            {
                op = null; return(false);
            }
            if (EXT_FULL(extension))
            {
                if (M68kDisassembler.EXT_EFFECTIVE_ZERO(extension))
                {
                    op = new M68kAddressOperand(Address.Ptr32(0));
                    return(true);
                }

                RegisterStorage base_reg        = null;
                RegisterStorage index_reg       = null;
                PrimitiveType   index_reg_width = null;
                int             index_scale     = 1;
                Constant        @base           = null;
                if (EXT_BASE_DISPLACEMENT_PRESENT(extension))
                {
                    @base = rdr.ReadBe(EXT_BASE_DISPLACEMENT_LONG(extension) ? PrimitiveType.Word32 : PrimitiveType.Int16);
                }

                Constant outer = null;
                if (EXT_OUTER_DISPLACEMENT_PRESENT(extension))
                {
                    outer = rdr.ReadBe(EXT_OUTER_DISPLACEMENT_LONG(extension) ? PrimitiveType.Word32 : PrimitiveType.Int16);
                }
                if (EXT_BASE_REGISTER_PRESENT(extension))
                {
                    base_reg = Registers.AddressRegister(opcode & 7);
                }
                if (EXT_INDEX_REGISTER_PRESENT(extension))
                {
                    index_reg = EXT_INDEX_AR(extension)
                        ? Registers.AddressRegister((int)EXT_INDEX_REGISTER(extension))
                        : Registers.DataRegister((int)EXT_INDEX_REGISTER(extension));
                    index_reg_width = EXT_INDEX_LONG(extension) ? PrimitiveType.Word32 : PrimitiveType.Word16;
                    if (EXT_INDEX_SCALE(extension) != 0)
                    {
                        index_scale = 1 << EXT_INDEX_SCALE(extension);
                    }
                }
                bool preindex  = (extension & 7) > 0 && (extension & 7) < 4;
                bool postindex = (extension & 7) > 4;
                op = new IndexedOperand(dataWidth, @base, outer, base_reg, index_reg, index_reg_width, index_scale, preindex, postindex);
            }
            else
            {
                op = new IndirectIndexedOperand(
                    dataWidth,
                    EXT_8BIT_DISPLACEMENT(extension),
                    Registers.AddressRegister(opcode & 7),
                    EXT_INDEX_AR(extension)
                        ? Registers.AddressRegister((int)EXT_INDEX_REGISTER(extension))
                        : Registers.DataRegister((int)EXT_INDEX_REGISTER(extension)),
                    EXT_INDEX_LONG(extension) ? PrimitiveType.Word32 : PrimitiveType.Int16,
                    1 << EXT_INDEX_SCALE(extension));
            }
            return(true);
        }
Exemple #10
0
 public IEnumerable <M68kInstruction> CreateDisassemblerImpl(ImageReader rdr)
 {
     return(M68kDisassembler.Create68020(rdr));
 }
Exemple #11
0
 public override IEnumerable <MachineInstruction> CreateDisassembler(ImageReader rdr)
 {
     return(M68kDisassembler.Create68020(rdr));
 }
Exemple #12
0
 public OperandFormatDecoder(M68kDisassembler dasm, int i)
 {
     this.dasm = dasm;
 }
Exemple #13
0
 private void BuildTest(Action <M68kAssembler> builder)
 {
     builder(asm);
     dasm = M68kDisassembler.Create68020(asm.GetImage().Image.CreateBeReader(asm.BaseAddress));
 }
Exemple #14
0
 private void BuildTest(Action <M68kAssembler> builder)
 {
     builder(asm);
     dasm = M68kDisassembler.Create68020(
         asm.GetImage().SegmentMap.Segments.Values.First().MemoryArea.CreateBeReader(asm.BaseAddress));
 }