Mercurial > hg > Members > kono > os9 > sbc09
changeset 135:7503617351c0
TL/1 buffered program read
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 07 Jan 2019 04:07:10 +0900 |
parents | 42592ea2966f |
children | 694412798333 |
files | TL1/TL1os9.asm |
diffstat | 1 files changed, 29 insertions(+), 19 deletions(-) [+] |
line wrap: on
line diff
--- a/TL1/TL1os9.asm Mon Jan 07 03:38:10 2019 +0900 +++ b/TL1/TL1os9.asm Mon Jan 07 04:07:10 2019 +0900 @@ -55,17 +55,19 @@ GEND RMB 2 SSW RMB 1 +filepath rmb 2 +parmptr rmb 2 +stdin rmb 1 +adr rmb 2 +work rmb 2 +bufsiz equ $100-1 + ** * LIBRARY ADDRESSS TABLE ** LIBR equ . ioentry rmb $80 -filepath rmb 2 -parmptr rmb 2 -stdin rmb 1 -adr rmb 2 -work rmb 2 -readbuff rmb $100 +readbuff rmb bufsiz+1 OBJSTART RMB 2 @@ -1626,11 +1628,10 @@ lbcs L0049 branch if error sta <INDN else save path to file stx <parmptr and updated parm pointer -* ldx <parmptr get param pointer -* lda ,x get char -* cmpa #C$CR end of command line? -* bne start branch if not - lbra comp + leax readbuff,u buffer + clr ,x buffer empty + stx <adr + lbra comp copytbl pshs y,x,u @@ -1685,27 +1686,36 @@ bra Exit +PUTCA tfr a,b +putchar * Output one character in B register. + PSHS X,Y + BRA OUTCH1 + close lda <INDN else get path os9 I$Close and close it bcs L0049 branch if error rts -PUTCA tfr a,b -putchar * Output one character in B register. - PSHS X,Y - BRA OUTCH1 - MEMIN PSHS A,B,X,Y + ldx <adr + lda ,x+ + bne GETCA1 LDA INDN - LEAX ,S - LDY #1 + LEAX readbuff,u + LDY #bufsiz OS9 I$Read BCC GETCA0 lda #'/' + ldx <adr + bra GETCA1 +GETCA0 LEAX readbuff,u + tfr y,d + clr d,x eof + lda ,x+ +GETCA1 stx <adr sta ,s -GETCA0 PULS A,B,X,Y,PC GETCA bsr getchar