Aw: Re: Aw: Re: Aw: [stella] BCD to pointer.

Subject: Aw: Re: Aw: Re: Aw: [stella] BCD to pointer.
From: cybergoth@xxxxxxxx
Date: Thu, 13 May 2004 11:25:51 +0200 (CEST)
Hi there!

> cybergoth@xxxxxxxx wrote:
> > Not sure. Wouldn't that divide the higher nibble by 10 and then multiply
> it
> > by 5 again? So maybe it's just a single LSR and you're done?!?
> Not sure about the divide (wouldn't 4 lsr's be 16), I just know it moves the
> value into the low nybble where I can treat it like the first value.
> And the original 8 line code had 1 lsr so I would need to sbc temp to get
> div
> by 5 but it's not that easy in practice :-(

Hm... LSR won't work with a bcd value, sorry. But the idea still is:

LDA value
AND #$F0
--> bcd_divide_by_2


How about:

LDA value
AND #$F0
STA temp
AND #%00000100
BEQ Done
LDA #5
ADC temp


Archives (includes files) at
Unsub & more at

Current Thread