You may have considered porting some BASIC code from one dialect to another.
Do not be dissuaded, the process can sometimes be rewarding.
When porting on BASIC to another, I have found the following guides to be useful:
Strip out all lines with references to POKE and PEEK.
This is my preferred strategy. Almost every system addresses memory differently, and has a different memory map.
Check the way arrays work on your target machine. Especially string arrays.
Many systems will allow simple string arrays, such as: S$(100)
But how long are these strings? How does the machine assign and evaluate each index? Some machines may even accept two-dimensional string arrays.
Every application will make use of some subset, and not every single feature of it’s machine’s arrays, so don’t be daunted. Sometimes the job can be done with very little modification.
INPUT statements may be an issue. Some parse input differently.
Does you machine have LINE INPUT, or just INPUT?
INPUT splits the input into multiple variables on commas in the input, whereas LINE INPUT puts the entire line into one variable.
File operations like OPEN and CLOSE will accept different arguments.
This can be quite tricky.
Since you have made it this far into the blog post, please consider the following table of conversions between my most used BASICS:
| Dartmouth | APPLESOFT | ATARI 8-BIT | BBC BASIC | COMMODORE BASIC V2 | |
|---|---|---|---|---|---|
| OPEN | FILE #file, “filename“ | OPEN filename | OPEN #fileno,mode control code,filename | var = OPENIN, var = OPENOUT | OPEN #exp, fileno, mode, “filename” |
| CLOSE | CLOSE “filename“ | CLOSE #fileno, #fileno | CLOSE #fileno; CLOSE #0 (all files) | CLOSE #fileno | |
| LOAD | LOAD filename | LOAD “disk:filename“ | LOAD “filename“ | LOAD “filename“,8,[disk] | |
| PRINT #file, record, … | PRINT exp, exp, … | PRINT #fileno, record, record, … | PRINT #filename, record, record, … | PRINT #fileno, record, record, … | |
| INPUT | INPUT #file, record, … | INPUT [string,] var, var, … | INPUT #[file,disk] var | INPUT #filename, record, record, … | INPUT “string” var, var, … |
Is your BASIC indexed from one (1) or zero (0)?
Because this is an easy one. Convert every index accordingly:
(e.g.) DIM A(255) -> DIM A(256)
(e.g.) FOR I=0 TO 255 -> FOR I=1 TO 256


