A86: Re: Variable-width font


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

A86: Re: Variable-width font




I wrote this routine for a game I am writting.  Just put your cursor
position into _penCol (if you use a 16-bit load it goes into _penRow as
well) and call this to display HL.

;====================================================================
; DisplayHL:  (idea from SCaBBy/Mardell)    [Assembly Coder's Zenith]
;  Display HL as a 5-digit decimal number with no leading zeros
;  out: AF, HL, BC, DE destroyed
;====================================================================
DisplayHL:
 ld c,'0'         ; save ascii value for zero
 ld de,_OP1+5      ; point to end of the buffer
 xor a        ; zero terminate string
 ld (de),a       ; set last byte to zero
DisplayHLl:
 call UNPACK_HL      ; next digit
 dec e        ; next position (e > 6)
 add a,c       ; convert to ascii
 ld (de),a       ; save digit
 ld a,h        ; load upper byte
 or l        ; check with lower byte for zero
 jr nz,DisplayHLl     ; loop
 ex de,hl       ; point to buffer
 jp _vputs       ; print number and return

-----Original Message-----
From: Dave VanEe <dvanee@dowco.com>
To: assembly-86@lists.ticalc.org <assembly-86@lists.ticalc.org>
Date: Wednesday, November 04, 1998 8:59 PM
Subject: A86: Variable-width font


>
>(I wonder if ppl hate me for my annoying posts yet?)
>
>oh well...
>How can I display the decimal (not hex) value of a register (hl?) onscreen
>in the variable width font at a specific location?
>
>Thanx,
>Dave