Re: A86: Dec to Hex


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

Re: A86: Dec to Hex




On Mon, 11 May 1998 19:50:13 -0600 Kirk Meyer <_@ibm.net> writes:
>
>;this routine is actually more efficient
>;modified routine by Kirk Meyer   5/11/98
>
>disp_ahl_hex:
>  call put_number
>  ld a,h
>  call put_number
>  ld a,l
>put_number:
>  push af
>  rrca
>  rrca
>  rrca
>  rrca
>  and %00001111
>  call put_digit
>  pop af
>  and %00001111
>put_digit:
>  push hl

why not use characters $0a thru $0f?
   cp a,$0a
   jr nc,put_digit_ok
   add a,'0'

-josh

>put_digit_ok:
>  call _putc
>  pop hl
>  ret
>
>
>-- 
>
>=====================================
>=                                   =
>=   Kirk Meyer (mailto:_@ibm.net)   =
>= http://www.bigfoot.com/~kirkmeyer =
>=                                   =
>=   "Set your affection on things   =
>=    above, not on things on the    =
>=      earth."  Colossians 3:2      =
>=                                   =
>=====================================
>
>

_____________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com
Or call Juno at (800) 654-JUNO [654-5866]


References: