Original Adapted Code (Searle)

<< Click to Display Table of Contents >>

Navigation:  Software > BASIC >

Original Adapted Code (Searle)

This is the original code and it works only for the 6850 ACIA module.

The code has been taken from Grant Searle, and he stated there:

Update 8th September 2013 - ROM BASIC updates. See the below for details.

Update 10th September 2013 - Cold/warm start no longer offered as an option for the first-time reset after power-up because cold is the only valid option. Thanks to Dave Curran for this suggestion.

This is the same BASIC that I use in the ROM on the CP/M computer. Originally from a Nascom computer, modified to remove all hardware-specific code.

I then removed all code and commands that were specific to the screen, graphics, keyboard and sound.

I wrote a serial handler to control the text I/O, along with suitable Control-C break handling.

Unused variable locations were removed.

The command/function tables were updated as needed for the updated command set, and pointer values adjusted accordingly.

Here is the zip containing the following:

Source files

intmini.asm - the interupt driven mini startup program needed to boot into BASIC

basic.asm - BASIC 4.7b - a conversion of Microsoft BASIC 4.7, as used on the Nascom computers (see below for details)

Output files

INTMINI.HEX

BASIC.HEX

ROM.HEX - the complete 8K ROM ready for burning to an EPROM - the unused contents are filled with FF values.

Within the ROM, the serial handler is first (starting at address 0000H), followed by the BASIC interpreter (starting at 0100H).

 

Assembler files (for Windows/DOS)

_ASSEMBLE.BAT - double-click in Windows to run the assembly if needed

TASM.EXE

TASM80.TAB

Acknowledgements:

BASIC is Microsoft BASIC 4.7 for the NASCOM, heavily modified by myself to remove references to different monitors, screen handlers and keyboard matrix reading.

TASM assembler is a partial distribution of the package from Speech Technology Incorporated.

 

And here are the information, what has been changed by him:

ROM BASIC (Microsoft BASIC 4.7) - details of what has been included/excluded

Update 8th September 2013 -

1. The HEX and BINARY identifiers have changed to &Hnnnn and &Bnnnn to match Microsoft implementations for other processors.

2. Width setting changed to 255 default, so no auto CR/LF are added when printing long strings.

3. HEX$(nn) and BIN$(nn) now have leading zeroes suppressed, as for other numeric output.

4. CR/LF processing changed slightly internally so that an LF is no longer auto-generated when sending a CR to the terminal.

INCLUDED TOKENS

SGN,INT,ABS,USR,FRE,INP,POS,SQR,RND,LOG,EXP,COS,SIN,TAN,ATN,PEEK,DEEK,LEN,STR$,VAL,ASC,CHR$,LEFT$,RIGHT$,MID$

END,FOR,NEXT,DATA,INPUT,DIM,READ,LET,GOTO,RUN,IF,RESTORE,GOSUB,RETURN,REM,STOP,OUT,ON,NULL,WAIT,

DEF,POKE,DOKE,LINES,CLS,WIDTH,MONITOR,PRINT,CONT,LIST,CLEAR,NEW

TAB,TO,FN,SPC,THEN,NOT,STEP

+,-,*,/,^,AND,OR,>,<,=

Note: there is also SET,RESET,POINT that call user-defined entry points, as in the ORIGINAL Nascom ROM (ie. not changed). Don't use unless you have defined the calling points for them (see the assembly listing for details).

EXCLUDED TOKENS (don't do anything if called)

SCREEN,CLOAD,CSAVE

NEW (my additional implementations)

HEX$(nn) - convert a SIGNED integer (-32768 to +32767) to a string containing the hex value

BIN$(nn) - convert a SIGNED integer (-32768 to +32767) to a string containing the binary value

&Hnn - interpret the value after the &H as a HEX value (signed 16 bit)

&Bnn - interpret the value after the &B as a BINARY value (signed 16 bit)

IMPORTANT NOTES

Integers in this version of BASIC are SIGNED - ie. -32768 to +32767. This includes memory locations when peek, poke, deek,doke commands are issued (etc.)

So, to refer to location "n" above 32767, you must provide the 2's compliment number instead (ie."n-65536") otherwise you will get an "?FC Error" message.

Functions that return integer values (such as the memory FRE(0) are also signed (!)) so anything bigger than 32767 will appear as a negative value.