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

Why BCD For Apple II+ & Apple //e Show Differently?



    Here is my sample code.

    SED
    LDA    #$99
    CLC
    ADC    #$01
    CLD

    I tell decimal flag to turn on BCD (Binary Coded Demical).  The result
for Apple II+ shows $20, but it for Apple //e shows $00.  I suspect that the
result is not correct.  It may be something that BCD is not calculated
correct.
    Or, HEX converts to BCD before do BCD math, and then converts back to
HEX.  Can you please give me the formula how to do HEX to BCD conversion and
ASCII to BCD conversion.  Please provide the info why the result is wrong.
Please advise.

--
Yours Truly,

Bryan Parkoff
BParkoff@satx.rr.com