Mercurial > hg > Members > kono > os9 > sbc09
changeset 162:d3a9f5f7befb
fix TL1 PIC
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 09 Apr 2019 22:49:44 +0900 |
parents | 91447c3ccd58 |
children | e09e66204c71 |
files | TL1/TL1os9.asm src/Makefile |
diffstat | 2 files changed, 49 insertions(+), 36 deletions(-) [+] |
line wrap: on
line diff
--- a/TL1/TL1os9.asm Tue Feb 12 09:16:24 2019 +0900 +++ b/TL1/TL1os9.asm Tue Apr 09 22:49:44 2019 +0900 @@ -53,6 +53,7 @@ RSW RMB 1 0 word lookup, 0xff word register mode in tlook GEND RMB 2 end of global name SSW RMB 1 +modofs RMB 2 module library offset filepath rmb 2 parmptr rmb 2 @@ -68,7 +69,7 @@ ioentry rmb $80 readbuff rmb bufsiz+1 -OBJSTART RMB 2+12 +OBJSTART RMB 12 * OBJECT PG AREA @@ -84,8 +85,23 @@ name fcs /TL1/ fcb edition +** OBJECT START +****** +C leas OBJECT,u +VARPTR lda INDN + lbsr close + clra os9 stdin + sta INDN + inca + sta OUTDN + LDX <PC + leay ,x +OBJMP JMP OBJECT,u -start clr <stdin + +start ldy #-2 17 xx xx + sty modofs + clr <stdin stx <parmptr save parameter pointer stu <work save parameter pointer lda #READ. read access mode @@ -299,7 +315,7 @@ WORD1 LBRA WORD ** STPOUT LBSR PUTHSL - FCB 3,$7E + FCB 3,$16 FDB exit RTS ** @@ -549,7 +565,7 @@ WTERM CMPA #$6C string BNE WR1 LBSR PUTHSL - FDB $03BD + FDB $0317 FDB PUTSTR LDA CH WR01 CMPA #'"' copy until '"' @@ -568,14 +584,14 @@ CMPA #$37 BEQ WR2 LBSR PUTHSL - FDB $03BD + FDB $0317 FDB CRLF RTS ** WR2 LBSR WEXPR BSR WTEN LBSR PUTHSL - FDB $03BD + FDB $0317 FDB CRLFA RTS ** @@ -583,7 +599,7 @@ BNE WR4 LBSR SUBSC LBSR PUTHSL - FDB $03BD + FDB $0317 FDB SPACEA RTS ** @@ -591,7 +607,7 @@ BNE WR5 LBSR SUBSC LBSR PUTHSL - FDB $03BD + FDB $0317 FDB PUTCA RTS ** @@ -600,13 +616,13 @@ LBSR DSUBSC LBSR PUTPLB LBSR PUTHSL - FDB $03BD + FDB $0317 FDB PUTDA+1 BRA WR66 ** WR6 LBSR EXPR LBSR PUTHSL - FDB $03BD + FDB $0317 FDB PUTDA WR66 RTS11 RTS @@ -987,12 +1003,12 @@ BHS ME4 LBSR PUTHSL FCB 3 - FCB $BD + FCB $17 FDB MULT BRA ME1 ME4 LBSR PUTHSL FCB 3 - FCB $BD + FCB $17 FDB DIV BRA ME1 ** @@ -1089,7 +1105,7 @@ LEAX 2,X DECA BRA PFC3 -PFC4 LDA #$BD +PFC4 LDA #$17 LBSR PUTA LDD ,X LBRA PUTAB @@ -1106,7 +1122,7 @@ BNE TM61 BSR SUBSC LBSR PUTHSL - FCB $03BD + FCB $0317 FDB RND RTS * FUNTION GET @@ -1117,7 +1133,7 @@ FDB $0297 FCB INDN LBSR PUTHSL - FCB $03BD + FCB $0317 FDB getchar RTS * FUNCTION READ @@ -1228,16 +1244,22 @@ STX YR LDX XR LEAX 1,X - BSR PCST + BSR RPCST LDX YR DP1 BEQ RT10 LDX ,X STX ZR LDX YR - BSR PCST + BSR RPCST LDX ZR STX YR BRA DP1 +RPCST LDD PC + pshs x + subd ,s++ + subd #2 + STD ,X + RTS ** * CALL PORC-FUNC ** @@ -1246,7 +1268,7 @@ CMPA PFMAX BCS *+4 STA PFMAX - LDA #$BD + LDA #$17 BSR AOUT LDX XR LDD 1,X @@ -1274,7 +1296,7 @@ STAABX STD ,X RT10 RTS ** -JMPOUT LDA #$7E +JMPOUT LDA #$16 AOUT LDX PC STA ,X BRA INCPC1 @@ -1291,7 +1313,9 @@ PULJMP BSR JMPOUT BSR PULSTK PCST2 LDX PC - BSR STAABX + pshs x + subd ,s++ + std ,x INCPC LEAX 1,X INCPC1 LEAX 1,X SETPC STX PC @@ -1339,7 +1363,7 @@ RTS ** * PUTHSL output with address calculation -* only working on 3 byte 7E/BD (JMP/JSR) +* only working on 3 byte 16/17 (LBRA/LBSR) ** PUTHSL LDX ,S++ LDB ,X+ @@ -1349,6 +1373,8 @@ leay 0,pcr leay d,y exg d,y + addd modofs + subd pc ldy pc std ,y++ sty pc @@ -1363,7 +1389,7 @@ TST ,X BEQ UDERR EL2 LEAX 3,X - DECA + DECA BRA EL1 UDERR PSHS A STA ZR @@ -1381,19 +1407,6 @@ EL LDX PC LBRA C -** OBJECT START -****** -C leas OBJECT,u -VARPTR lda INDN - lbsr close - clra os9 stdin - sta INDN - inca - sta OUTDN - LDX <PC - leay ,x -OBJMP JMP OBJECT,u - ********************** * ADVANCE WORD **