Category:6502 Assembly: Difference between revisions

Content added Content deleted
mNo edit summary
Line 147: Line 147:
* If a register already contains a value that has an A,B,C,D,E or F digit, setting or clearing the decimal flag <b>will not change that.</b>
* If a register already contains a value that has an A,B,C,D,E or F digit, setting or clearing the decimal flag <b>will not change that.</b>
* In your assembler, your values need to be encoded as hexadecimal, like the example above. Using decimal numbers in your assembly in decimal mode will result in inaccurate values. This is because the numbers are internally adjusted to only show digits below 9, rather than a true decimal output. The value is still technically stored in hexadecimal.
* In your assembler, your values need to be encoded as hexadecimal, like the example above. Using decimal numbers in your assembly in decimal mode will result in inaccurate values. This is because the numbers are internally adjusted to only show digits below 9, rather than a true decimal output. The value is still technically stored in hexadecimal.
* The Decimal Mode <b>does not function on the Nintendo Entertainment System or its derivatives (i.e. the Famicom, Vs. System, or Play Choice 10)</b>. The flag can be set or cleared, but has <i>no effect on the calculation</i>. If you are programming for those systems you will have to re-create its functionality with your own code (which isn't too difficult considering almost every game kept score).
* The Decimal Mode <b>does not function on the Nintendo Entertainment System or its derivatives</b> (i.e. the Famicom, Vs. System, or Play Choice 10). The flag can be set or cleared, but has <i>no effect on the calculation</i>. If you are programming for those systems you will have to re-create its functionality with your own code (which isn't too difficult considering almost every game kept score).
* On the 65C02, <code>ADC</code> and <code>SBC</code> take an additional CPU cycle to execute while the processor is in decimal mode.


==Addressing Modes==
==Addressing Modes==