Mercurial > hg > Members > kono > os9 > sbc09
changeset 142:7368ad797016
frame pointer
function/procedure arugment not worked
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 10 Jan 2019 22:42:15 +0900 |
parents | 19ddf9e805cf |
children | 3abfb68fb043 |
files | TL1/TL1os9.asm |
diffstat | 1 files changed, 41 insertions(+), 28 deletions(-) [+] |
line wrap: on
line diff
--- a/TL1/TL1os9.asm Tue Jan 08 07:24:26 2019 +0900 +++ b/TL1/TL1os9.asm Thu Jan 10 22:42:15 2019 +0900 @@ -45,7 +45,9 @@ GLL RMB 1 left value g 0xff / local l AMODE RMB 1 ACC RMB 1 -LSIZE RMB 1 +LSIZE RMB 1 local variable size (including arguments ) +MXLSZ RMB 1 maximul local variable size +LSZADR RMB 2 where to write MXLSZ TCOUNT RMB 1 1 search reserved word only, 5 search all local/global var/array, proc TEND RMB 2 table end (search start from here ) include local name WEND RMB 2 word end @@ -68,7 +70,7 @@ ioentry rmb $80 readbuff rmb bufsiz+1 -OBJSTART RMB 2+12 +OBJSTART RMB 2+9 * OBJECT PG AREA @@ -142,9 +144,15 @@ STA PMODE LDA VAL LBSR DEFPF - LBSR PUTHSL - FDB $03BD - FDB PSHLB + LBSR PUTHS + FCB $04 + FDB $AFE3 stx ,--s + FDB $3088 leax n,x + LDX <PC + STX <LSZADR here to write MXLSZ + LDA LSIZE + STA MXLSZ + LBSR PUTA BSR REG0 CLR LSIZE LBSR WORD @@ -158,6 +166,9 @@ CMPB #1 BNE *+5 LBSR RETP generate return + LDX LSZADR + LDB MXLSZ + STB ,X LDX GEND STX TEND LDB #5 @@ -268,9 +279,8 @@ DECB BEQ RETP LBSR EXPR -RETP LBSR PUTHSL - FDB $037E - FDB PULLB +RETP LDD #$3590 puls x,pc + LBSR PUTAB RTS ** * PROC CALL @@ -880,9 +890,9 @@ STA LSW COMA STA ACC - LDA AMODE - CMPA #$20 - BNE *+5 +* LDA AMODE amode is sometime wrong? +* CMPA #$20 +* BNE *+5 * LBSR PUTX CLR LSW PULS A @@ -1011,15 +1021,19 @@ LDA LSIZE PSHS A INC LSIZE -PFC2 INC LSIZE - LBSR WEXPR +PFC2 INC LSIZE + LDA MXLSZ + CMPA LSIZE + BHI PFC5 + STA MXLSZ +PFC5 LBSR WEXPR CLRB STB ACC DECB STB GLL - LDA #$A7 - LDB LSIZE - LBSR PUTABX +* LDA #$A7 +* LDB LSIZE +* LBSR PUTABX LDA SY CMPA #$3C BEQ PFC2 @@ -1443,32 +1457,31 @@ ** OBJECT START ****** C leas OBJECT,u -VARPTR LDX <PC - STX GB - STX LB - lda INDN +VARPTR lda INDN lbsr close clra os9 stdin sta INDN inca sta OUTDN + LDX <PC + leay ,x OBJMP JMP OBJECT,u ** * PUSH LB & SET NEW LB ** -PSHLB pshs y - leay ,x - leax a,x - sty ,x++ - puls y,pc +*PSHLB pshs y +* leay ,x +* leax a,x +* sty ,x++ +* puls y,pc ** * PULL LB ** * -PULLB LDX ,--X - TSTA - RTS +*PULLB LDX ,--X +* TSTA +* RTS ** * RND FUNCTION **