Ejemplo n.º 1
0
        public int Step()
        {
            int opcode = this.getCurrent();

            this.incrPc();

            InstructionCaller ic = this.instructions[opcode];

            if (ic == null)
            {
                // Unknown opcode is interpreted as KIL instruction
                this.kil = true;
                return(0);
            }

            this.getOper(ic.mode);

            return(ic.call());
        }
Ejemplo n.º 2
0
        public string GenLog()
        {
            int opcode           = this.getCurrent();
            InstructionCaller ic = this.instructions[opcode];

            return(string.Format(
                       "    {0}  {1:x2} {2}: {3,5}\t\t{4:x2} {5:x2}     A:{6:x2} X:{7:x2} Y:{8:x2} P:{9:x2} SP:{10:x2}        CYC:{11}",
                       this.getPc().ToString("x2"),
                       opcode,
                       ic.getName(), // instruction,
                       ic.mode,      // mode,
                       this[this.getPc() + 1].ToString("x2"),
                       this[this.getPc() + 2].ToString("x2"),
                       this.ac,
                       this.x,
                       this.y,
                       this.sr,
                       this.sp,
                       this.cycle
                       ));
        }