Re: [stella] Does this look right? (clock)

Subject: Re: [stella] Does this look right? (clock)
From: Piero Cavina <p.cavina@xxxxxxxxxxxxx>
Date: Fri, 3 Oct 1997 14:01:25 +0100
At 16:41 +0000 2-10-1997, Erik Mooney wrote:

>>>Try this.  Frames, seconds, minutes, and hours count down instead of up.
>>>You can deal with this later.  Days count up.
>>A problem with this clock is that it counts seconds, minutes and hours in
>>hex and this means a conversion to BCD in case you want to display it.
>So simply store the numbers in BCD and use the 6502's BCD-math flag to
>process them.  I did this for the scores in my invaders game.  It takes one
>byte per field (frames, seconds, minutes, hours, days) in either hex or
>Simply put a SED at the beginning and a CLD at the end of the routine I
>posted, and change the #60 to #$60 and #24 to #$24.


>>If you can modify it so it counts DOWN to 0 for each value, it becomes much
>>more simpler again.
>>dec FRAMES
>>bne DoneClock
>>lda #60
>>sta FRAMES
>>bne DoneClock
>>sta SECONDS      ;A was already 60 so no need to reload it

So you say that DECs would work in BCD afer a SED? You may be right, but I
admit I have never checked this.


Archives updated once/day at
Unsubscribing and other info at

Current Thread