CX et TRSE et PROG8 et COMAL (et al) for X16

Chat about anything CX16 related that doesn't fit elsewhere
TomXP411
Posts: 1785
Joined: Tue May 19, 2020 8:49 pm

CX et TRSE et PROG8 et COMAL (et al) for X16

Post by TomXP411 »



On 2/20/2021 at 7:37 AM, desertfish said:




pascal like syntax is extremely verbose and uses long keywords, which will eat up precious memory and disk space on the x16.  Just something to consider if you want to edit/process these files on the machine itself.



The editor and compiler should use banked memory for code storage, and the final program should run at $800. We should be okay, with 512K to compile a 38K program. 

Stefan
Posts: 456
Joined: Thu Aug 20, 2020 8:59 am

CX et TRSE et PROG8 et COMAL (et al) for X16

Post by Stefan »



12 minutes ago, TomXP411 said:




The editor and compiler should use banked memory for code storage, and the final program should run at $800. We should be okay, with 512K to compile a 38K program. 



I totally agree. We have a lot of memory and disk to play with.

BruceMcF
Posts: 1336
Joined: Fri Jul 03, 2020 4:27 am

CX et TRSE et PROG8 et COMAL (et al) for X16

Post by BruceMcF »



On 2/22/2021 at 2:30 AM, TomXP411 said:




You didn’t read the full document, did you? There are three different loop structures, and all are taken straight from BBC BASIC. 



No, I didn't. WHILE/WEND and REPEAT/UNTIL loops are less flexible than CBM/QBasic Basic DO LOOP, and  even there GOTO is stll needed for some loop structures. Making the tests orthogonal to the loop fixes that issue.

BEGIN-BLOCK operation test operation END-BLOCK is the most generic loop structure, since it intrinsically provides:

BEGIN-BLOCK test operation END-BLOCK

BEGIN-BLOCK operation test END-BLOCK

... as the QBASIC DO [UNTIL/WHILE] ... LOOP [UNTIL/WHILE] loops do, and if done correctly, it can also provide:

BEGIN-BLOCK operation1 test1 operation2 test2 operation3 END-BLOCK

... which is handy for a range of string processing loops ... test for condition, and test for end of string.

The optimization referred to is that in the interpreter version, LOOP keywords can be chained together, (token $priorloopaddress) typically making finding the first loop following a failing test substantially faster than a BASIC GOTO that searches sequentially for the line. DO / LOOP can use the FOR/NEXT stack, by relying on an impossible variable reference address, such as $0000.

Post Reply