Re: A83: _formreal


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

Re: A83: _formreal




In a message dated 2/22/00 1:32:56 PM US Mountain Standard Time, 
tankrshr77@yahoo.com writes:

> does anyone know what rom call- _formreal  does?

formreal is a great routine if you are writing math programs, or even just 
need to display a floating point number.  It is similar to the str$( ) 
command in VB or QB.  Formreal takes the value in Op1 (the maximum display 
length of the string is loaded into the accumulator) and converts it into a 
standard zero terminated string that starts at Op3.  Here is a brief example.

;************************
; There should be a number in op1 to display.
; This will display a number in large font, at cursor location 0,0
    call _homeup        ;Set the cursor to 0,0
    ld a,16             ;Display no more than 16 characters
    call _formreal      ;Convert Op1 into a string
    ld hl,op3           ;have hl point to the string
    call _puts          ;Display the string at current cursor location
;************************

I hope that helps,
Ted