示例#1
0
        public static int GetParamBytes(addressing addrMode)
        {
            switch (addrMode)
            {
            case addressing.implied:
                // No operand
                return(0);

            case addressing.relative:
                // Operand is a signed byte
                return(1);

            case addressing.immediate:
                // Operand is a byte literal
                return(1);

            case addressing.zeropage:
            case addressing.zeropageIndexedX:
            case addressing.zeropageIndexedY:
            case addressing.indirectX:
            case addressing.indirectY:
                // All operate on zero-page
                return(1);

            case addressing.absolute:
            case addressing.indirect:
            case addressing.absoluteIndexedX:
            case addressing.absoluteIndexedY:
                // All use 16-bit address
                return(2);

            default:
                throw new ArgumentException("Invalid addressing mode specified.");
            }
        }
示例#2
0
 public op(byte index, string name, addressing addressing, int cycleCount, bool valid, bool mystery)
 {
     this.index      = index;
     this.name       = name;
     this.addressing = addressing;
     this.cycleCount = (byte)cycleCount;
     this.valid      = valid;
     this.mystery    = mystery;
 }