Menu

Tree [r172] /
 History

HTTPS access


File Date Author Commit
 test-suite 2026-07-11 litwr [r172] ERR$ is added, ER=16 is added, tests refactoring
 basic35wl.txt 2024-03-27 litwr [r163] USR is added
 cbm35basic.cpp.l 2026-07-11 litwr [r172] ERR$ is added, ER=16 is added, tests refactoring
 cbm35basic.cpp.y 2026-07-11 litwr [r172] ERR$ is added, ER=16 is added, tests refactoring
 cbm35basic.h 2026-07-06 litwr [r169] fixed HEADER, DS; a test for disk io; several m...
 cbm35basic.inc 2026-07-11 litwr [r172] ERR$ is added, ER=16 is added, tests refactoring
 cbm35basic.mac 2026-07-08 litwr [r171] small fixes in PRINT and init arrays; a bug fix...
 code.cpp 2026-07-03 litwr [r168] added RESUME; improved: ER, tokenization, test ...
 compile-bas-tmpx 2024-03-27 litwr [r165] tiny fixes for the v0.04 final
 gc.s 2026-07-11 litwr [r172] ERR$ is added, ER=16 is added, tests refactoring
 gc2.s 2026-07-11 litwr [r172] ERR$ is added, ER=16 is added, tests refactoring
 gc3.s 2016-06-28 micro [r141] gc3 conservation
 makefile 2020-12-27 litwr [r159] fixing and improvement of shellsort
 makefile.win32 2024-03-27 litwr [r165] tiny fixes for the v0.04 final
 plus4.mac 2026-07-06 litwr [r169] fixed HEADER, DS; a test for disk io; several m...
 readme.txt 2026-07-11 litwr [r172] ERR$ is added, ER=16 is added, tests refactoring

Read Me

HOW TO COMPILE THE COMPILER

The requirements: bison, make, c++, lex or flex, the pcrecpp library.  Just type `make'.


HOW TO USE

Just run `cbccwif INPUT.bas >OUTPUT.asm'.  This produces OUTPUT.asm in the TMPX assempler format.  The files `gc.s', `gc2.s', `cbm35basic.mac', `cbm35basic.inc', and `plus4.mac' have to be at the same directory as `INPUT.asm' at the assemble stage.  The script `compile-bas-tmpx' provides the pattern example.

You can start your loaded compiled code with RUN or SYS4109.  To start program that keeps its variables use POKE154,0:SYS4128.

Supported operators: ^ / * + - ( ) = < > <= >= =< => <> ><

Supported keywords:
ABS AND ASC ATN CHAR CHR$ CLOSE CLR CMD COLLECT COLOR COPY DATA DEC DEF DIM DIRECTORY DO DS DS$ ELSE END ER ERR$ EXIT EXP FN FOR FRE GET GET# GETKEY GO GOSUB GOTO HEADER HEX$ IF INPUT INPUT# INSTR INT JOY KEY LEFT$ LEN LET LOAD LOG LOOP MONITOR MID$ NEW NEXT NOT ON OR OPEN PEEK PI POKE POS PRINT PRINT# PUDEF RCLR RDOT READ REM RENAME RESTORE RESUME RETURN RGR RIGHT$ RLUM RUN SAVE SCNCLR SCRATCH SGN SOUND SPC ST STEP STR$ SYS TAB THEN TI TI$ TO TRAP UNTIL USING USR VAL VERIFY VOL WAIT WHILE

Unsupported keywords:
BOX CIRCLE CONT COS DRAW EL GRAPHIC LOCATE GSHAPE PAINT RND SCALE SIN SSHAPE STOP TAN TROFF TRON

Keywords that cannot be supported:
AUTO BACKUP DELETE DLOAD DSAVE HELP LIST RENUMBER


The difference with ROM Basic:

- instead of the floating point type the pseudo-fp type is used that is actually 3-byte integers;

- CLR and RUN don't destroy variables, they just make them empty or zero;

- CMD only supports one parameter;

- DIM doesn't allow variables in the dimensions definition;

- DIRECTORY allows only unit numbers less than 10;

- ER has a very limited set of values;

- FOR-NEXT and DO-LOOP must be paired, i.e. one NEXT for one FOR;

- NEW does reset;

- RESUME only works in form RESUME LINE-NUMBER;

- RDOT always returns 0;

- USR uses the pseudo-fp instead of the Commodore fp, it places its argument to $61-$63 and returns the result from the same memory locations;

- keywords should be spelled fully, the shortcuts are not allowed;

- this program is distributed under the GNU General Public License, Version 2, or, at your discretion, any later version. The GNU General Public License is available via the Web at <http://www.gnu.org/copyleft/gpl.html>. The GPL is designed to allow you to alter and redistribute the package, as long as you do not remove that freedom from others;

This is free, fast and dirty compiler designed to compile Notepad+4.  It is not a Visual Studio.


The generated code generally uses the next zero page locations: 3-6, $14, $15, $22-$25, $39, $3a, $3f-$42, $bc, $bd, $f1, $f2, $f5, $f6 (5,6 used only with SQR).

Monday.com Logo