Re: A86: base 10 display of hex
[Prev][Next][Index][Thread]
Re: A86: base 10 display of hex
yeah, but floating point numbers take three times as many bytes and they
are slow (besides, if a wanted that i would use BCD numbers instead).
here's my current code (input AHL)
disp_ahl_deci:
push hl
pop ix
ld h,0
ld l,a
ld b,$18
disp_ahl_loop:
add ix,ix
adc hl,hl
dec lx
ld a,h
cp $0A
jr z,disp_ahl_okay
sub $0A
ld h,a
disp_ahl_okay:
djnz disp_ahl_loop
;this is just the division by 10 routine (which is what i need help
with). it only outputs one number at a time.
Thanx
Dux Gregis wrote:
>
> Why don't you use floating point? It doesn't display *too* slowly.
> But, if your really pressed for a 32 bit number and you want it display
> faster, change ix for bc or something like it. I don't think you'll find
> a ROM call if that's what you're looking for.
>
> Kirk Meyer wrote:
>
> > Well, I've been checking the mailing list archives and the discussions
> > seem to be worthwhile again, so here I am. And I have a question of my
> > own.
> >
> > Does anyone know how to display AHL as a decimal? The built in routine
> > only supports numbers ranging from $000000 to $09FFFF. I need to range
> > from $00000000 to $09FFFFFF (one extra byte of precision). I wrote a
> > routine using IX but I think its slow. I need it for SIM Community so
> > that the population and money can be greater than $09FFFF (or 655359).
> >
> > --
> >
> > =====================================
> > = =
> > = Kirk Meyer (mailto:_@ibm.net) =
> > = http://www.bigfoot.com/~kirkmeyer =
> > = http://simcommunity.home.ml.org =
> > = =
> > = "Set your affection on things =
> > = above, not on things on the =
> > = earth." Colossians 3:2 =
> > = =
> > =====================================
--
=====================================
= =
= Kirk Meyer (mailto:_@ibm.net) =
= http://www.bigfoot.com/~kirkmeyer =
= http://simcommunity.home.ml.org =
= =
= "Set your affection on things =
= above, not on things on the =
= earth." Colossians 3:2 =
= =
=====================================
Follow-Ups:
References: