Hacker News new | ask | show | jobs
by hota_mazi 960 days ago
The first time I saw this trick was with ProDOS on the Apple ][, circa 1983.

ProDOS came up with this new call syntax where the parameters to the API follow the call to it.

For example:

            ldx #$00
            ldy #$10        
            sty params+4
            stx params+5    ; setup number of bytes to read (16)
            jsr $BF00       ; call ProDOS
            .BYTE $CA       ; ProDOS command number = CA (read)
            .WORD params    ; address of parameter table, lo/hi
            bcs error       ; carry set, error
            .
            .
            
     params .BYTE $04       ; number of parameters for a read
            .BYTE $00       ; file reference number, 0, 1, 2 in MacQForth
            .WORD BUFFER    ; pointer to data buffer
            .WORD $0000     ; requested number of bytes to read, fill in
            .WORD $0000     ; number actually read, returned by ProDOS