コード例 #1
0
        public Disassembler()
        {
            Labeller       = new Labeller(this);
            Namer          = new Namer(this);
            CPU            = new LR35902(this);
            Ports          = new List <IPortHandler>();
            Comments       = new Dictionary <uint, string>();
            CustomOperands = new Dictionary <uint, CustomOperandList>();
            DataTypes      = new Dictionary <uint, DataType>();
            Instructions   = new Dictionary <uint, Instruction>();

            SetupPorts();
        }
コード例 #2
0
        public Instruction(Disassembler dis, OpCode op, uint loc) : this()
        {
            Parent      = dis;
            Location    = loc;
            Address     = new BankedAddress(loc);
            Op          = op;
            OperandSize = LR35902.GetOperandSize(op);

            OperandBytes = Tool.Slice(Parent.ROM, loc + 1, loc + TotalSize);
            IsEnd        = LR35902.IsOpEnd(op);
            JumpLocation = LR35902.GetJumpDestination(op, loc + 1, OperandBytes);

            if (Op == OpCode.PREFIX_CB)
            {
                CBOp = (CBOpCode)OperandBytes[0];
            }

            OpType   = DetermineOpType(Op, CBOp);
            Operands = DetermineOperands();
        }