• Re: Apple Monitor: Print Integer?

    From Joshua Bell@inexorabletash@gmail.com to comp.sys.apple2 on Wednesday, December 23, 2020 12:06:05
    From Newsgroup: comp.sys.apple2

    On Wednesday, July 5, 2017 at 5:59:50 AM UTC-7, Michael 'AppleWin Debugger Dev' wrote:
    LINPRT ... that's helluva lot of code just to print an unsigned 16-bit int. The only good news is that it is built-into ROM.

    Usage:

    LDA #$12
    LDX #$34
    JMP $ED24

    Output:
    4660

    NOTE: Stack $100 .. $1104 is used as output buffer.

    Requires:

    * $E000 Basic Cold Start or
    * $E003 Basic Warm Start

    must be called first.

    To document for posterity:

    I wanted to use LINPRNT without fully initializing Basic. Assuming at least ProDOS has started (i.e. you're in a SYS file), it appears you can get away with just the following:

    SHIFT.SIGN.EXT set to 0; required by FP routines
    TEMPPT set to TEMPST; it's a string descriptor pointer
    SPEEDZ set to 1, for no output delay
    FLASH.BIT set to 0, to get normal characters

    Equates per http://www.txbobsc.com/scsc/scdocumentor/definitions.html


    --- Synchronet 3.18b-Win32 NewsLink 1.113