.enabl lc .title TTY functions for C (RT11) enbspc:: bis #50100, @#44 ;Enter special mode rts pc disspc:: bic #50100, @#44 ;Exit special mode rts pc ttyin:: ;Read byte from console .mcall .ttyin .ttyin rts pc ttyinr:: ;Read byte, if none, return -1 .mcall .ttyinr .ttyinr bcc 10$ ;Gotcha mov #-1,r0 10$: rts pc ttyout:: .mcall .ttyout mov 2(sp),r0 .ttyout rts pc ttyput:: ;ttyput(buffer, buflen) .mcall .ttyout mov 4(sp),r1 ;count ble 20$ mov r2,-(sp) mov 4(sp),r2 ;buffer 10$: clr r0 bisb (r2)+,r0 .ttyout sob r1,10$ mov (sp)+,r2 20$: rts pc .end