[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Recreate 6502 Bug II



>     It is the way to put legal and illegal results from Accumulator and
> Value through ADC and SBC.  Accumulator ranges from $00 to $FF.  Value
> ranges from $00 to $FF.  Only result shows the range between $00 and $5F
and
> $80 and $DF.  It is why I created two loops to capture into 65536 records.

sorry you lost me a bit. I guess you are saying that #$95 + #$05 is not
setting the Z, V and N flag correctly after a BCD ADC. ie they are set
according the the HEX sum not the BCD sum, and that IS the bug. I think the
Carry would be OK. if that is what is happening then I guess that IS a bug.
a work around could possibly be to use a CMP #$00 to fix up the Z and N
flags, don't know about V though.

it seems like you are trying to find out why it happens, and I guess the
simple answer would be that they stuffed up in the design of the 6502.
perhaps anyone who has found the bug previously has come up with a work
around.

on a slightly similar topic I do recall that there are also Opcodes on the
6502 that are not all used and using them can produce different
"undocumented" results, and this will vary for each brand of 6502. would you
call that a bug too if a programmer used them ?

Mark