        TTL     > TOS06 - OSWord / OSArgs; Simple OS traps

tim_bget =      sv_bget
        RTS

; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

tim_bput =      sv_bput
        RTS

; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

tim_file =      sv_file
        RTS

; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

tim_find =      sv_find
        RTS

; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

tim_gbpb =      sv_gbpb
        RTS

; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

tim_rdch =      sv_rdch
        RTS

; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

tim_wrch =      sv_wrch
        RTS

; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
; OSWORD requires fudging for BASIC, Pascal reading command line on Host

tim_word ROUT

        CMPIM   5               ; Read Host address ?
        BNE     dotimword

        STX     tmpptr
        STY     tmpptr+1        ; Read Tube memory instead
        LDYIM   0
        STY     tmpptr+turbo
        LDAIY   tmpptr          ; Put address in zp so we can indirect off it
        STA     vstrptr
        INY
        LDAIY   tmpptr
        STA     vstrptr+1
        LDXIM   0
        LDAIX   vstrptr         ; No need to stick in Turbo byte for IX ops
        LDYIM   4               ; Put byte in cblk
        STAIY   tmpptr
        LDX     tmpptr
        LDY     tmpptr+1
        RTS

dotimword
        =       sv_word
        RTS

; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

tim_args ROUT

        CMPIM   1
        BNE     realargs
        CPYIM   0
        BNE     realargs        ; Have to fudge read command tail call

        STY     cliptr+turbo    ; Y=0
        DEY                     ; Y=&FF

scamper ; Skip to space or eoln

        INY
        LDAIY   cliptr
        CMPIM   " "
        BCC     scrumpend
        BNE     scamper
        JSR     skipspaces      ; and over any spaces too

scrumpend
        CLC
        TYA
        ADC     cliptr
        STAZX   0
        LDA     cliptr+1
        ADCIM   0
        STAZX   1
        LDYIM   &FF             ; pB compatibility
        STYZX   2
        STYZX   3
        INY                     ; Back to 0
        LDAIM   1
        RTS

realargs
        =       sv_args
        RTS


        LNK     TOS11
