Mercurial > hg > Members > kono > os9 > sbc09
changeset 180:c3145f913f3d
possible features
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 04 May 2019 11:17:42 +0900 |
parents | 41d578d28d8c |
children | aa6398acd2d5 |
files | TL1/Todo TL1/test/t4.tl1 |
diffstat | 2 files changed, 37 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/TL1/Todo Mon Apr 15 14:21:00 2019 +0900 +++ b/TL1/Todo Sat May 04 11:17:42 2019 +0900 @@ -1,3 +1,35 @@ +Sat May 4 10:39:12 JST 2019 + + possible extension + + array as an arguments + put entire array on stack ( callee's local variable ) + ARRAY TEND[] allocate pointer size buffer 2 for 6809, 4 for 32bit, 8 for 64bit + anonymous array + "test" + "test\n\0" + INT(0,1,2,3) ARRAY of CPU endian orderd int + + memory stream + DICT := OPENM(INT(2,0)) allocate $200 memory + write to the stream (should be BYTE(0)) + WRITE(DICT:ASCII(0)) + + TEND := POSITION(DICT) get stream pointer in TENC + return array offset in frame pointer, copied in caller's code + SEEK(DICT,INT(0)) set position in byte + + VAL := SEEK(DICT,TEND) set absolute position to TEND and get the value + K:=SEEKR(DICT,-1) seek relative and get a value (K can be an array) + HASNEXT(DICT) eof check + + multibyte arithmetic + NEG(PTR) + PTR := PTR+PTR1 + PTR := PTR-PTR1 + PTR := PTR*PTR1 + PTR := PTR/PTR1 + Mon Apr 15 00:18:30 JST 2019 8bit/16bit offset
--- a/TL1/test/t4.tl1 Mon Apr 15 14:21:00 2019 +0900 +++ b/TL1/test/t4.tl1 Sat May 04 11:17:42 2019 +0900 @@ -4,17 +4,16 @@ VAR DICT,BUF ARRAY TEND[2] BEGIN - POSITION(DICT,TEND) - DICT := OPENM($2,0) + DICT := OPENM((INT($2,0)) WRITE(DICT:ASCII(0)) 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) + TEND := POSITION(DICT) + BUF := OPENM(INT($2,0)) WRITE(BUF:"FUNC",ASCII(0)) WRITE(0:SEARCH(BUF),CRLF) - SEEK(BUF,0) + SEEK(BUF,INT(0)) WRITE(BUF:"NONAME",ASCII(0)) WRITE(0:SEARCH(BUF),CRLF) END @@ -24,7 +23,7 @@ ARRAY BEND BEGIN VAL := SEEK(DICT,TEND) - POSITION(BUF,BEND) + BEND:=POSITION(BUF) WHILE VAL#0 DO [ C:=SEEKR(BUF,-1) K:=SEEKR(DICT,-1)