I don't see what Ada version of 6502 has over Nim's, see 
<https://github.com/mratsim/glyph/blob/8b278c5/glyph/snes/datatypes.nim#L35-L89>
    
    
    type
      # Note using uint8 instead of machine word size will add zero-extending 
overhead at every load
      
      CPUStatusKind* = enum
        Carry                   ## C - 0b00000001
        Zero                    ## Z - 0b00000010
        IRQ_Disabled            ## I - 0b00000100
        Decimal_Mode            ## D - 0b00001000
        Index8bit               ## X - 0b00010000
        Accum8bit               ## M - 0b00100000
        Overflow                 ## V - 0b01000000
        Negative                ## N - 0b10000000
        Emulation_mode          ## E - hidden / B - Break 0b00010000. Define if 
6502 mode or 65816 mode
      
      CpuRegs* = object
        # General purpose registers
        A*: uint16              ## Accumulator - Math register. Stores operands 
or results of arithmetic operations.
        X*, Y*: uint16          ## Index registers. Reference memory, pass 
data, counters for loops ...
        # Addressing registers
        D*: uint16              ## Direct page addressing. Holds the memory 
bank address of the data the CPU is accessing.
        DB*: uint8              ## Data Bank. Holds the default bank for memory 
transfers.
        # Program control register
        PB*: uint8              ## Program Bank. Holds the bank address of all 
instruction fetches.
        PC*: uint16             ## Program Counter. Address of the current 
memory instruction.
        SP*: uint16             ## Stack Pointer.
        # Status register
        P*: set[CPUStatusKind]  ## Processor status
      
      AddressingMode* = enum
        # $number represents a number in hexadecimal representation
        # Name                  # Example
        Accumulator             # dec a
        Implied                 # clc
        Immediate               # inc #$12 or #$1234
        Absolute                # and $1234
        AbsoluteLong            # and $123456
        AbsoluteLongX           # and $123456,X
        AbsoluteX               # and $1234,X
        AbsoluteY               # and $1234,Y
        AbsoluteXIndirect       # jmp ($1234,X)
        AbsoluteIndirect        # jmp ($1234)
        AbsoluteIndirectLong    # jml [$1234]
        Direct                  # and $12
        DirectX                 # stz $12,X
        DirectY                 # stz $12,Y
        DirectXIndirect         # and ($12,X)
        DirectIndirect          # and ($12)
        DirectIndirectLong      # and [$12]
        DirectIndirectY         # and ($12),Y
        DirectIndirectLongY     # and [$12],Y
        ProgramCounterRelative  # beq $12
        ProgCountRelativeLong   # brl $1234
        StackRelative           # and $12,S
        StackRelativeIndirectY  # and ($12,S),Y
        BlockMove               # mvp $12, $34
      
      Cpu* = object
        regs*: CpuRegs
        cycles*: int
    
    
    Run

Reply via email to