Re: A85: Display
[Prev][Next][Index][Thread]
Re: A85: Display
Here's a simple, small routine that I think should replace D_HL_DECI. This
version lets you set how many spaces to pad the number to, so if you used
it to display a 8 bit number, you'd set it to three and it'd look just like
D_A_DEC. Hope this has the possibility of helping.
;******************* Display Number routine *************************
; needs 6 bytes temp storage called asciiNumb
;Description: Displays a number on the screen in text format
;Parameters: hl - number to display
; b - number of places (1-5) to display
; de - location on screen
;Destroys: a, b, de, hl
DisplayNumber:
push de
ld de, asciiNumb+5
DispNumbLoop:
dec de
call UNPACK_HL
add a, '0'
ld (de), a
djnz DispNumbLoop
ex de, hl
pop de
ld (CURSOR_X), de
res 3, (IY+5)
ROM_CALL(D_ZT_STR)
ret
At 10:26 AM 8/14/97 -0700, you wrote:
>82nd Deer wrote:
>>
>> Well, using Z-Shell, you can display a 2 byte number by using D_HL_DECI.
>> To display a 1 byte number, do:
>>
>> ld h, 0
>> ld l, a
>> call D_HL_DECI
>>
>> and there you go.
>
>What we really need is a D_A_DECI routine, maybe not in the ROM, but at
least
>with the shell and not with DISPLIB. I really don't want to include DISPLIB
>just for that routine.
>(Did I already mention this? I don't know if I said it to the list or
someone
>else. Sorry if I already did)
>
>
>--
>Terry Peng
>email- tpeng@geocities.com
>web- http://www.geocities.com/SiliconValley/Bay/5104/index.html
>
>
---
Evil Jim
Viva La Mexico
<eviljim@geocities.com>
http://members.tripod.com/~eviljim/
I want to die in my sleep like my Grandfather, not screaming in pain like
the passengers in my car...
References: