Re: A86: Disp AHL


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

Re: A86: Disp AHL





On Tue, 22 Sep 1998 08:00:51 -0700 Chicane <chicane@reninet.com> writes:
>
>Hey guys, i have a question. Doesn anyone have a good diplay ahl 
>routine in
>variable width font?  I tried using a modified Joshua Seagoe DispHL
>routine, but i cant get it to work right when there is more than 65k 
>free.
>Any help would be appreciated.

hm, well that's cuz hl is 16 bits wide.
here, this should work up to 8589934591 or so, but it uses ahlix.
(i suppose, for memory that's a bit excessive.)

DispAHLIX:
	ld de,$c08d
	ld b,10		;10 digits
DispAHLIX1:
	call ahlix_div10 ;could be placed inline
	add a,$30	;convert to decimal digit
	ld (de),a	;store it
	dec de
	xor a
	djnz DispAHLIX1
	ld ($c08e),a	;end the string
	ex de,hl

	ld a,$30	;trim leading zeros
	ld bc,9		;take these 7 lines
	inc hl		;out and put in one
DispAHLIX2:		;inc hl
	cpi		;instruction if
	jp z,DispAHLIX2	;you want to
	dec hl		;keep them

DispAHLIX3:
	call _vputs	;display it
	ret

;divide 33-bit number in ahlix by 10
;(modified rom routine)
;output is:
; a - remainder
; hlix - quotient
ahlix_div10:
	push bc
	ld bc,$0a21	;b=33 bits, c=divide by 10 
ahlix_loop:
	add ix,ix
	adc hl,hl
	rla
	cp c
	jp c,ahlix_zero
	sub c
	inc l
ahlix_zero:
	djnz ahlix_loop
	pop bc
	ret

-josh

>
>CHICANE
>ICQ: #14727618
>chicane on EFNET #ti
>Homepage: Under Construction.
>

_____________________________________________________________________
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: