Home‎ > ‎SC/MP II Max‎ > ‎

fBASIC

Information on being able to  run Floating Basic on SCAMPII Max board.

The basic idea is the same as on this website. NIBL program is in the 0000-1FFF area .. and fBasic in upper ram from D000-FFFF..

For this setup test  I placed the PIA only from C800-CFFF....

Here s the newer pld listing ...

Name            ScampII max board, nibl@1000H and Fbasic@1200 baud;
Partno          0001;
Revision        Ver 1;
Date            24/10/17;
Designer        mc;
Company         mcoz;
Location        oz;
Assembly        manual;
Device          g22v10;

/** Inputs **/
pin [1..5] = [a2..a6] ;
pin [7..11] = [a7..a11] ;
pin 13 = a12;
pin 14 = a13;
pin 15 = a14;
pin 16 = a15;

/*nrds ... read output **/
pin 20 = nrds;


/** Outputs **/

pin 22 = !piaCS;
/**pin 21 = !acaCS;**/
pin 23 = !memCS;


/** Declarations and Intermediate Variable Definitions **/

field ioaddr= [a15..2];
/** acaCS_eqn    = ioaddr:[E000..AFFF]; **/ 
piaCS_eqn   = ioaddr:[C800..CFFF];



memCS_eqn    = ((ioaddr:[0000..1FFF])& !nrds)#(ioaddr:[2000..C7FF])#((ioaddr:[D000..FFFF])& !nrds);

/** Logic Equations **/


piaCS = piaCS_eqn ;
/**acaCS  = acaCS_eqn; **/
memCS  = memCS_eqn;



Note that the NIBL runs with 7 bit data and... when you switch to fBASIC you need 8 bit data.

Here is updated RAM binary file - download.


On reset you run your terminal at 1200,7bits, no parity no handshake. Once you get the prompt you can switch to fBASIC by typing

LINK #DFC1

You will probably get some garbage on screen .. adjust terminal program to 8 bits. and pressing return should give you a ready message. You can test various commands. to get back to NIBL type in

BYE

Here is snapshot of some commands in fBASIC


It should be possible to adjust the values of the delays to increase the baud rate to 2400 ..

and yes tested if this will work ..

RESULT  .. the NIBL runs OK @2400 baud, 7bits, 1stop bit .. but when you switch to fBASIC
It still wants to communicate @1200, 8bits, 1 stip bit
Here is the combined file of NIBL and fBASIC  - 2400baudNIBL1200fBASIC

fBASIC COMMANDS

Constant


  • PI (3.14159)

Variables


  • Variable names have to start with A-Z and range between 1E-39 and 1E38.
  • String variable names end with a $ e.g. TEXT$. The user has to supply the starting address of the string in the coresponding variable TEXT.
  • Only one dimensional arrays are possible. The number of elements in the array must be specified in a DIM statement. The user has to supply the starting address of the array in the memory in the coresponding variable.
    e.g.: meas=#4100: DIM MEAS(20): MEAS(9)=542: PRINT MEAS(9)

Expressions


  • FREE returns the number of bytes left in the page
  • PAGE returns the current page number
  • RND returns a random number between 0 and 1
  • STAT returns the value of the INS8060 Status Register
  • TOP returns the highest address of the NIBL program in the current page

Program entry


  • AUTO n generates line numbers starting at number n (ctrl c to quit)
  • AUTO n,m generates line numbers starting at n with increment m (ctrl c to quit)
  • BYE quit floating point basic
  • EDIT n allows for editing of line n. Characters may be inserted with cntrl Q and deleted with cntrl X, cntrl C will exit EDIT
  • LINK x link with user routine
  • LIST
  • LIST n
  • LIST n-m
  • NEW
  • NEW x

Decleration Statements


  • CLEAR clears all variables and stacks
  • DATA
  • DEF FN
  • DIM
  • LET

DEF FN must be followed by a character A-Z, so 26 user defined functions are possible. An expression between brackets can be added to transfer a parameter e.g.: DEF FNA (SQROOT) = SQR(SQROOT) INPUT A PRINT FNA(A): REM prints square root of A
DEF FNB = SIN(X)+1 INPUT X PRINT FNB

Program Flow Control


  • DO / UNTIL
  • END
  • FOR / NEXT / STEP
  • GOTO
  • GOSUB / RETURN
  • ON ... GOSUB / GOTO
  • IF ... THEN ...: ELSE
  • IF ... THEN n: ELSE
  • IF ...: ELSE
  • READ
  • RESTORE
  • RESTORE n

Numeric functions


Floating point numbers have to be between 10E-39 and 10E38. Maximal nesting of 5 brackets. Numbers larger than 8.388.607 have to be entered in exponantial form. Normal accuracy is 6 digits.
  • + - / * **
  • DIV
  • MOD
  • ABS
  • SQR
  • ATN
  • SIN
  • COS
  • TAN
  • INT
  • LB logarithm on base 2
  • LG logarithm on base 10
  • LN logaritm on e
  • EXP
  • SGN

Logical Operators


  • AND
  • EXOR
  • NOT
  • OR

Relational Operators


  • =
  • <>
  • >=
  • <=
  • >
  • <

String Functions


  • ASC
  • LEN
  • VAL
  • CHR$
  • LEFT$
  • MID$
  • RIGHT$
  • STR$

String Concatination &

e.g. VAR = TOP: VAR1 = TOP + 72 VAR1$ = "123456": VAR$ = RIGHT$(VAR1$,2)&CHR$(65)&"LT"&MID$(VAR1$,2,3) PRINT VAR$

String Comparisment


  • IF var$ = "string" ...
  • IF var1$ = var2$ ...

Input/Output


  • INPUT "string" ...
  • INPUT ...
  • PRINT
  • PR
  • TAB(x)
  • SPC(x)
  • VERT(x)
  • VERT(-x)
  • PEEK
  • POKE
  • #DFC1 (hexadecimal number)