Registers

The command line now recognizes 6502 Registers.  Namely,

You can set a Register to a hex Value, Symbol, or Expression.  (See the section Calculator for more examples of using expressions.)  The syntax is:


Command

Effect

R r [=] ####

Set Register to (a byte) Value, Symbol, or Address, or Expression.

R A ##

Set Accumulator to (a byte) Value

R X ##

Set Register X to (a byte) Value

R Y ##

Set Register Y to (a byte) Value

R PC ####

Set PC to (a full 16-bit) Address (Value)

R S ##

Set Stack Register to (an 8-Bit) Offset

R P ##

Set Processor Status Register (flags) to (a byte) Value



Notes:


Examples:

Input

Effect

R PC FA62

Set Program Counter to Value $FA62 (RESET)

R PC RESET + 1

Set Program Counter to Address $FA63 (RESET+1)

R X 2

Set Register to Value 2

R Y 3

Set Register to Value 3

R S 1FE

Set Stack Pointer to depth of one (Stack grows down from $01FF)

R S FF

Set Stack Pointer to top of stack (Empty)

R A 0A

Set Accumulator to hex Value 0A

R A #A

Set Accumulator to hex Value 0A

R X A

Set Register X to Accumulator’s Value

R A A1

If the symbol A1 exists, sets Accumulator to the Address of the symbol A1
If the symbol A1 doesn't exist, sets Accumulator to the hex Value A1

R A $A1

If the symbol A1 exists, sets the Accumulator to the Address of symbol A1
If the symbol A1 doesn't exist, sets Accumulator to the hex Value A1

R A #A1

Sets Accumulator to the hex value A1