G.G. (Italy)
8BASIC theory 2/6 : telephone-like KEYPAD
8BASIC (C) is a BASIC interpreter developed by manufacturer G.G in 2010 for the homemade Z80/AM95 8 bit NANO COMPUTER.
8BASIC doesn't have line numbers but uses line labels which may be referenced by control flow statements.
VARIABLES
Statements use variables to keep track of numbers or strings or labels.
Variables and labels must consist of only one alphabetical character.
So the maximum number of GOTO/GOSUB's arguments is 26 and the labelled addresses are precompiled into RAM in a separate table during the program editing.
The range of the 26 numeric values which can be entered or stored, lies between -9.99999 and +9.99999 x 10^5 (always displayed in 8-char fixed format: six digits plus sign and decimal dot). Variables are anyway stored in RAM in floating-point representation during program editing when declared (precomplilation) or during interpretation for the intermediate results. The precision of intermediate calculations depends on the APU 9511 capability (1 bit sign, 7 bit two's complement exponent and 24 bit of mantissa).
During editing, just after having selected the correct statement, you can easily change any of the 26 letters of each variable, navigating through the alphabet using the telephone-like keypad.
For example the generic statement "Z=X+Y" which performs the addition, can be easily modified in
"A=X+Y" or
"A=A+A" or
"Z=X+Z" or
"A=A+X" etc..
It is also easy to handle any algebraic expression using multiple 8-chars functions managing intermediate results.
For example Z=2*A+15*C can be written as:
" LET X="
"+15.0000" ;X=15
"X=X*C " ;X=15*C
"B=A+A " ;B=2*A
"Z=B+X " ;Z=2*A+15*C
Each of the 26 text variables may contain max eight alphanumeric characters and symbols, as per the complete DL2416 character set.
But you may build texts with more chars by concatenating strings stored in consecutive letters (variables), with the last string ending with the "#" char: text will be displayed by scrolling right-to-left. So technically the max size of a displayed string is 207 characters.
Here the typical "Hello Word" program which displays the string "Hello World" in an infinite loop:
" LET A$="
"HELLO WO" ; A$="HELLO WO"
" LET B$="
"RLD# " ; B$="RLD"
" "F": " ; F label
"PRINT+A$" ; display from right to left A$&B$ = "HELLO WORLD"
"GO TO F " ; goto F and loop
" END "
8BASIC theory 2/6 : telephone-like KEYPAD
8BASIC (C) is a BASIC interpreter developed by manufacturer G.G in 2010 for the homemade Z80/AM95 8 bit NANO COMPUTER.
8BASIC doesn't have line numbers but uses line labels which may be referenced by control flow statements.
VARIABLES
Statements use variables to keep track of numbers or strings or labels.
Variables and labels must consist of only one alphabetical character.
So the maximum number of GOTO/GOSUB's arguments is 26 and the labelled addresses are precompiled into RAM in a separate table during the program editing.
The range of the 26 numeric values which can be entered or stored, lies between -9.99999 and +9.99999 x 10^5 (always displayed in 8-char fixed format: six digits plus sign and decimal dot). Variables are anyway stored in RAM in floating-point representation during program editing when declared (precomplilation) or during interpretation for the intermediate results. The precision of intermediate calculations depends on the APU 9511 capability (1 bit sign, 7 bit two's complement exponent and 24 bit of mantissa).
During editing, just after having selected the correct statement, you can easily change any of the 26 letters of each variable, navigating through the alphabet using the telephone-like keypad.
For example the generic statement "Z=X+Y" which performs the addition, can be easily modified in
"A=X+Y" or
"A=A+A" or
"Z=X+Z" or
"A=A+X" etc..
It is also easy to handle any algebraic expression using multiple 8-chars functions managing intermediate results.
For example Z=2*A+15*C can be written as:
" LET X="
"+15.0000" ;X=15
"X=X*C " ;X=15*C
"B=A+A " ;B=2*A
"Z=B+X " ;Z=2*A+15*C
Each of the 26 text variables may contain max eight alphanumeric characters and symbols, as per the complete DL2416 character set.
But you may build texts with more chars by concatenating strings stored in consecutive letters (variables), with the last string ending with the "#" char: text will be displayed by scrolling right-to-left. So technically the max size of a displayed string is 207 characters.
Here the typical "Hello Word" program which displays the string "Hello World" in an infinite loop:
" LET A$="
"HELLO WO" ; A$="HELLO WO"
" LET B$="
"RLD# " ; B$="RLD"
" "F": " ; F label
"PRINT+A$" ; display from right to left A$&B$ = "HELLO WORLD"
"GO TO F " ; goto F and loop
" END "