Commodore +4 Basic Cross-Compiler with Italian flavor

It is very fast to work with integers, strings and pseudo-reals. The pseudo-real number occupies 3 bytes and has range from -223 to 223-1. They've replaced the original 5 bytes Commodore real numbers. Graphics is not supported. The generated code is rather big in size so don't use it for a text larger than 20–30 KB.

The next keywords are supported: 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.

The next keywords have support with some limitations: CMD only supports one parameter, DIM doesn't allow variables in the definition of the dimensions, DIRECTORY is only for units number < 10, ER has a limited set of values, LOAD works only with ML data/programs, FOR-NEXT and DO-LOOP must be paired (i.e. one NEXT for one FOR), RESUME only works in form RESUME LINE-NUMBER, USR uses the different format for the floating point numbers.

The next keywords use ROM code and therefore they may be slow: KEY, DIRECTORY, USING.

The next keywords are not supported: BOX, CIRCLE, CONT, COS, DRAW, EL, GRAPHIC, LOCATE, GSHAPE, PAINT, RND, SCALE, SIN, SSHAPE, STOP, TAN, TROFF, TRON.

The next keywords can't be supported by any compiler: AUTO, BACKUP, DELETE, DLOAD, DSAVE, HELP, LIST, RENUMBER.

USAGE: rcbccwif BASIC-TEXT-FILE >ASSEMBER-TEXT-FILE or rcbccwif -no BASIC-TEXT-FILE >ASSEMBER-TEXT-FILE
The -no option disables the optimization stage. This stage has not been thoroughly tested. If your code is not working the way you expect, try using this option. There is a very small chance that this will help.

Use a text file not a prg-file. Use, for example, PETCAT from VICE emulator distribution to convert a PRG-file to a plain text file. petcat -3 -o TEXT-FILE PRG-FILE makes the trick.

The produced assembler text should be converted to a prg-file by TMPX assembler. tmpx ASSEMBER-TEXT-FILE makes this convertion. The inc/mac/s-files (5 total) from the cbccwif-distribution must be situated in the same directory as ASSEMBER-TEXT-FILE.

If you have a Basic program in the plain text format and you want to try it with the built-in interpreter use PETCAT: tmpx -w3 -o PRG-FILE TEXT-FILE.

The compiler v0.05 is available via a build for Microsoft Windows (413K) and a Subversion repo. The latter contains more documentation.