Changes

Jump to: navigation, search

6502 Math

10 bytes added, 01:31, 18 September 2023
Decimal Mode
In decimal mode, the each byte is treated as two decimal digits - the lower 4 bits represent the lower digit, and the upper 4 bits represent the upper digit. Numbers are counted as positive, and values greater than 9 are invalid.
Decimal mode is selected by setting the D (Decimal) flag in the [[6502#Registers|Status Register]] using the <code>SED</code> instruction, and binary mode is selected by clearing the D flag using the <code>CLD</code> instruction.
The rest of this page deals with binary mode (decimal mode operates in mostly the same way).

Navigation menu