THIS PAGE IS NOT FINISHED YET. SO NO
Other BASICODE overviews:
Content of this page:
- BASICODE has a standard
method of putting programs on a tape
(frequency and ASCII codes)
- BASICODE variables names are maximum two characters long.
The first character has to be a capital letter and the optional second
letter can be a number or a capital letter.
- All variables beginning with O
are reserved for use inside
the BASICODE Translator.
- BASICODE-3C reserved variable names are: A, AS, AT, CC, CN, CT, FN,
HO, GR, IF, IN,
IN$, LN, NF, NF$, PI, RV, SD, SP, SR, SR$, ST, TI, TO, SV, VE and VG.
BY can't be used when incorporating BB4W (did not exists when
BASICODE was developed) in list of BASICODE
- String have a maximum length of 255 characters.
- A BASICODE line is maximum 60 characters (also the DEF FN
- BASICODE-4's initialization (after GOTO 20) sets HO and VE to
the screen size of the text window (HO = number of characters per line
minus one; VE = number of lines minus one).
- BASICODE-4 program should end with GOTO 950
- BASICODE screens is preferable at least 40 chapters wide
- Graphics proportions are horizontal : vertical = 4 : 3 .
- (VE,HO) = (0,0) is top left corner of graphical and text screen
Colours in BASICODE-4
The colour of the background colour is set with
CC(1). The forgroundcolour is set in CC(0). The colour values are
all text or graphic commands. You can set CC(0) and CC(1) at the
Allowed BASICODE-4 commands
The following commands are allowed:
PRINT, INPUT, GOTO, GOSUB, RETURN, LET, FOR...TO...STEP, NEXT,
ELSE), ON...GOTO, ON...GOSUB, DIM, READ, DATA, RESTORE,
REM. DEF FN (or DEFFN) is allowed (only one variable, no
recursion, only arithmetic and logical expressions)
Allowed BASICODE functions
The following functions are allowed:
TAB, ABS, SGN, INT, SQR, SIN, COS, TAN, ATN,
EXP, LOG (natural logarithm), ASC, VAL, LEN, CHR$, LEFT$, MID$, RIGHT$.
Allowed BASICODE operators
The following operators were allowed:
AND, OR, NOT, + (also with strings), -, *, /, ^ (exponent), <,
<=, <>, >=
- 10 First
line of subroutine module (one is not allowed to call this line from
the BASICODE program)
- 20 System
reset, clearing of variables, etc. Furthermore it starts the
programs (one is only allowed to call this line from the BASICODE
program at the start)
- 100 Go to text window
and clear text screen.
- 110 Set cursor to
position given by the variables HO and VE.
- 120 Return cursor
position in variables HO and VE.
- 150 Print SR$ in a
pronounced way (like inverse text). Three characters are inserted at
the beginning and appended at the end.
- 200 Read key stroke and
return it in IN$ and IN.
special codes: 28 = cursor left, 29 = cursor right
30 = cursor down, 31 = cursor up
127 = delete
no key pressed: IN$="" and IN=0
CN contains the ASCII-code of the capital letter if a small one is
pressed and the other
Furthermore IN can now contain function keys. If a function key is
pressed IN contains its negated number.
- 210 Wait and read the
pressed key and return it in IN$ and IN (see for special codes line
- 220 Provide in IN the
code present at screen position given by the variables HO and VE (see
for special codes line 200).
- 250 Beep.
- 260 Return random number
in RV (0 <= RV < 1).
- 270 Do a garbage collect
and return the amount of free memory in FR
- 280 Disable the
stop/break key (FR=1) or enable (FR=0).
- 300 Convert number SR to
string, returned in SR$
- 310 Convert number SR to
string with a string length of CT and with CN places after decimal
point; returned in
- 330 Convert all letters
in SR$ to capital letters
- 350 Print SR$ on the
- 360 Carriage return and
line feed on the printer.
- 400 Produce a tone using
SP, SD and SV
SP is frequency level: 0 = lowest, 60='central C', 127 = highest
SD is the tone duration in steps of 0.1 seconds
SV is the volume: 0=muted 7=medium, 15=loud
This subroutine keeps running during the time of SD.
- 450 Wait SD*0.1 seconds
or for a key stroke
When ended: IN$ and IN contain the possible keystroke (see for special
codes line 200). SD contains the remaining time from the moment the key
was pressed or zero
(if no key was pressed)
- 500 Open the file NF$
according to the code in NF:
NF = even number: input: NF= uneven number: output
NF= 0 or 1 BASICODE cassette
NF= 2 or 3 own system memory
NF= 4 or 5 diskette
NF= 6 or 7 diskette
IN=0: all OK, IN=1: end of file, IN=-1: error
- 540 Read into IN$ from
the opened file NF$ (in IN the status, see line 500)
- 560 Send SR$ towards the
opened file NF$ (in IN the status, see line 500)
- 580 Close the file with
- 600 Switch to graphic
screen and clear graphic screen
- 610 Plot a point at
graphic position HO,VE (0<=HO<1 en 0<=VE<1) in foreground
color <CC(0)> if CN=0 or in background color
<CC(1)> if CN=1
- 630 Draw a line towards
point HO,VE (0<=HO<1 en 0<=VE<1) in foreground color
<CC(0)> if CN=0 or in background color <CC(1)> if CN=1
- 650 Print SR$ as text
from graphic position HO,VE (0<=HO<1 en 0<=VE<1). HO and VE
stay the same value.
- 950 End the program and
set the BASIC interpretator in normal mode.
The following line numbers method is used in BASICODE-4:
0 - 999: The BASICODE translator subroutines;
1000 - 1010: mandatory in the form of:
1000 A=<total memory space needed of all strings>: GOTO 20: REM program-name
1010 <rest of program>
1011 - 19999: The rest of the BASICODE program;
20000 - 24999: possible machine-dependant subroutines;
25000 - 29999: DATA-lines;
30000 - 31999: REM-lines with a short description of the program and links to literature;
32000 - 32767: REM-lines with name and address of author.
Running BASICODE programs
A working program can be made by having the BASICODE
program (using line numbers from 1000 and up) and merge before that
one the BASICODE
translator (which uses line number from 0 to 999) for your system.
merged one gets a fully operation program fit for the BASIC
interpretator of the system one is using. This program can run by using
the RUN command.
Disclaimer and Copyright
Major content related changes: March 30, 2008