Mercurial > hg > Members > kono > os9 > sbc09
changeset 178:4d83154d2a78
add - {} some builtin in TL/1
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 15 Apr 2019 09:43:28 +0900 |
parents | 3770e86114aa |
children | 41d578d28d8c |
files | TL1/TL1os9.asm TL1/test/t4.tl1 |
diffstat | 2 files changed, 50 insertions(+), 29 deletions(-) [+] |
line wrap: on
line diff
--- a/TL1/TL1os9.asm Mon Apr 15 04:27:18 2019 +0900 +++ b/TL1/TL1os9.asm Mon Apr 15 09:43:28 2019 +0900 @@ -325,7 +325,7 @@ ** * PROC CALL ** -SS4 CMPA #2 +SS4 CMPA #2 proc LBEQ PFCALL CMPA #$E0 BCS SS5 @@ -401,7 +401,13 @@ ** ** NON-STATEMENT ** -SSEND COM SSW +SSEND CMPA #$A2 seek + LBEQ EXPR + CMPA #$A3 seekr + LBEQ EXPR + CMPA #$A4 position + LBEQ EXPR +SSEND1 COM SSW RTS ** SS6 CMPA #$58 @@ -578,10 +584,10 @@ LBSR GETCH LBRA WORD ** -WR1 CMPA #$6B +WR1 CMPA #$6B CRLF BNE WR3 LBSR WORD - CMPA #$37 + CMPA #$37 '(' BEQ WR2 LBSR PUTHSL FDB $0317 @@ -595,7 +601,7 @@ FDB CRLFA RTS ** -WR3 CMPA #$6A +WR3 CMPA #$6A SPACE BNE WR4 LBSR SUBSC LBSR PUTHSL @@ -603,7 +609,7 @@ FDB SPACEA RTS ** -WR4 CMPA #$69 +WR4 CMPA #$69 ASCII BNE WR5 LBSR SUBSC LBSR PUTHSL @@ -611,7 +617,7 @@ FDB PUTCA RTS ** -WR5 CMPA #$26 +WR5 CMPA #$26 # BNE WR6 LBSR DSUBSC LBSR PUTPLB @@ -985,18 +991,18 @@ ** MEXPR BSR TERM ME1 LDA SY - CMPA #$8E + CMPA #$8E * BEQ ME2 - CMPA #$8F + CMPA #$8F / BNE RTE1 ME2 PSHS A LBSR WORD BSR TERM LDB LSW BEQ ME3 - LDA #$C6 + LDA #$C6 LDB BSR OCORD - FCB $8C + FCB $8C ??? ME3 BSR PUTPUL PULS A CMPA #$8E @@ -1004,7 +1010,7 @@ LBSR PUTHSL FCB 3 FCB $17 - FDB MULT + FDB MULT should MUL inst BRA ME1 ME4 LBSR PUTHSL FCB 3 @@ -1027,8 +1033,21 @@ STA AMODE COM LSW LBRA WORD +* Uniary minus operator +TM1 CMPA #$80 + BNE TM02 + LBSR WORD + BSR TERM + LDB LSW + BEQ TM03 + NEG <OPER + RTS +TM03 LBSR PUTHS + FCB $2,$35,$2 puls a + LDA #$04 NEGA + LBRA PUTA * CONST TRUE & FALSE -TM1 CMPA #$A0 +TM02 CMPA #$A0 BEQ TM01 CMPA #$A1 BNE TM2 @@ -1625,11 +1644,13 @@ FCB $35,-';' FCB $36,-'[' FCB $37,-'(' + FCB $34,-'{' FCB $38,-'E' FCC "ND" FCB $39,-'=' FCB $3A,-']' FCB $3B,-')' + FCB $38,-'}' FCB $3C,-',' FCB $3D,-':' FCB $50,-'S'
--- a/TL1/test/t4.tl1 Mon Apr 15 04:27:18 2019 +0900 +++ b/TL1/test/t4.tl1 Mon Apr 15 09:43:28 2019 +0900 @@ -1,43 +1,43 @@ % ** TEST PROGRAM ** FUNC SEARCH %--- MAIN --- -VAR DICT,BUF,D +VAR DICT,BUF ARRAY TEND[2] BEGIN - WRITE(DICT:ASCII(0)) + POSITION(DICT,TEND) DICT := OPENM($2,0) WRITE(DICT:ASCII(0)) - WRITE(DICT:ASCII(30),ASCII(0-'P'),"ROC") - WRITE(DICT:ASCII(31),ASCII(0-'F'),"UNC") - WRITE(DICT:ASCII(33),ASCII(0-'V'),"AR",CRLF) - D:=POSITION(DICT,TEND) + WRITE(DICT:ASCII(30),ASCII(-'P'),"ROC") + WRITE(DICT:ASCII(31),ASCII(-'F'),"UNC") + WRITE(DICT:ASCII(33),ASCII(-'V'),"AR",CRLF) + POSITION(DICT,TEND) BUF := OPENM($2,0) WRITE(BUF:"FUNC",ASCII(0)) WRITE(0:SEARCH(BUF),CRLF) - D:=SEEK(BUF,0) + SEEK(BUF,0) WRITE(BUF:"NONAME",ASCII(0)) WRITE(0:SEARCH(BUF),CRLF) END SEARCH(BUF) -VAR VAL,K,C,D +VAR VAL,K,C ARRAY BEND BEGIN VAL := SEEK(DICT,TEND) - D:=POSITION(BUF,BEND) + POSITION(BUF,BEND) WHILE VAL#0 DO [ - C:=SEEKR(BUF,0-1) - K:=SEEKR(DICT,0-1) + C:=SEEKR(BUF,-1) + K:=SEEKR(DICT,-1) IF K.LT.0 THEN [ - IF C=0-K THEN + IF C=-K THEN RETURN VAL % FOUND - VAL := SEEKR(DICT,0-1) + VAL := SEEKR(DICT,-1) ] ELSE IF C#K THEN [ - D:=SEEK(BUF,BEND) + SEEK(BUF,BEND) REPEAT - K:=SEEKR(DICT,0-1) + K:=SEEKR(DICT,-1) UNTIL K.LT.0 - VAL := SEEKR(DICT,0-1) + VAL := SEEKR(DICT,-1) ] ] RETURN VAL % NOT FOUND