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. FOR-statement may be used with the integer. Graphics is still 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 fully supported: ABS, AND, ASC, ATN, CHAR, CHR$, CLOSE, CLR, CMD, COLLECT, COLOR, COPY, DATA, DEC, DEF, DO, DS, DS$, ELSE, END, EXIT, EXP, FN, FOR, FRE, GET, GET#, GETKEY, GO, GOSUB, GOTO, HEADER, HEX$, IF, INPUT, INPUT#, INSTR, INT, JOY, KEY, LEFT$, LEN, LET, LOG, LOCATE, LOOP, MONITOR, MID$, NEW, NOT, ON, OR, OPEN, PEEK, PI, POKE, POS, PRINT, PRINT#, PUDEF, RCLR, RDOT, READ, REM, RENAME, RESTORE, RETURN, RGR, RIGHT$, RLUM, RUN, SAVE, SCNCLR, SCRATCH, SGN, SOUND, SPC, ST, STEP, STR$, SYS, TAB, THEN, TI, TI$, TO, UNTIL, USING, VAL, VERIFY, VOL, WAIT, WHILE.

The next keywords have support with some limitations: DIM (no variables allowed in the dimensions definition), DIRECTORY (only for units number < 10), LOAD (works only with compiled and ML data/programs), NEXT (no multiple NEXT are allowed for one FOR), TRAP (it is not removed automatically after the 1st error catched), USR (it uses the different format for the floating point numbers).

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

The next keywords are not supported: BOX, CIRCLE, CONT, COS, DRAW, EL, ER, ERR$, GRAPHIC, GSHAPE, PAINT, RESUME, 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: cbccwif BASIC-TEXT-FILE >ASSEMBER-TEXT-FILE

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 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: PETCAT -w3 -o PRG-FILE TEXT-FILE.

The compiler v0.04 is available via sources (28K), a build for Microsoft Windows (410K) and a Subversion repo.