Enhanced BASIC on your system by Lee Davison.
Hardware.
EhBASIC can be made to work on nearly any 6502 system, it requires very little. The system it was developed on is a combination of my SBC and 6551 projects.
Memory.
EhBASIC makes extensive use of page zero and some use of page 2. Some areas may be re-used as long as care is taken. Program and variable space is from $0300 up to
whatever is available, the more the better. The interpreter can be ROM or RAM based and can be assembled to reside almost anywhere in memory, only minor changes need
to be made.
Software.
For minimal functionality the interpreter needs only two external routines, a character get routine and a character send routine. For full functionality two other external routines, load and save, along with two interrupt service routines are needed. Minimal set-up is required, most of the set-up is performed by the interpreter cold start routine.
How to.
The interpreter calls the system routines via RAM based vectors and, as long as the requirements for each routine are met, these can be changed on the fly if needs be. All the routines exit via an RTS.
The routines are ..
Input | This is a non halting scan of the input device. If a character is ready it should be placed in A and the carry flag set, if there is no character then A, and the carry flag, should be cleared. |
Output | The character to be sent is in A and should not be changed by the routine. Also on return, the N and Z flags should reflect the character in A. |
Load | This is entirely system dependant. |
Save | This is entirely system dependant. |
Also if you wish to use the ON {IRQ|NMI} commands ..
Irq | If no other valid interrupt has happened then this routine should, after checking that the interrupt is set-up, set the IRQ interrupt happened flag. |
Nmi | If no other valid interrupt has happened then this routine should, after checking that the interrupt is set-up, set the NMI interrupt happened flag. |
Example code.
Example code for all the above is provided if the file min_mon.asm that is included in the main source code archive.