Yuri wrote:
So I'm working to convert the assembly level functions for the Kowalski emulator into C; that way it can be made portable across platforms.
Pedantic note: the Kowalski package is a simulator...it doesn’t emulate any hardware
Quote:
One thing I've noticed is it seems that it has different BCD behavior for if it's in "Basic 6502" mode (I presume original MOS) and 6501/65C02
The reason for that is only carry is valid when the NMOS 6502 is performing BCD addition and subtraction. The negative (n) and zero (z) flags are meaningless, as they reflect the result of the underlying binary operation that occurs before decimal correction is applied.
On the other hand, the 65C02’s n and z correctly reflect the BCD result. This is also true with the 65C816, whether in emulation or native mode.
The overflow (v) flag is an outlier in BCD arithmetic, as the 6502 family can only do unsigned BCD addition and subtraction. Hence v is effectively meaningless in BCD mode.