Changes

MOS 6502

66 bytes added, 10 March
/* Decimal Mode */
== Decimal Mode ==
The 6502’s Decimal (BCD operations are limited to addition and subtraction using the ) mode automatically adjusts ADC and SBC instructionsresults, while the Z80 requires a DAA instruction after each BCD addition and subtraction.
On NMOS, when Decimal Mode is on, the ADC and SBC instructions update NF, VF and ZF based on the binary result before the decimal correction is applied. Only CF is updated correctly. On CMOS, all the flags are updated correctly, at the cost of 1 additional cycle.
13,146
edits