Creating a generic interpreter and memory management

Discussion about other targets
Post Reply
Neuxsone1984
Member
Posts: 30
Joined: Fri Feb 10, 2017 3:36 pm

Creating a generic interpreter and memory management

Post by Neuxsone1984 »

I wondering if there is already a barebones example of creating a BASIC/C type console type interpreter and basic memory management
like you find in your basic 8-bit machine.

For example at the prompt:
:>int A=1 creates a variable A & B
:>int B=2

Call PRINT type command

:>print A + B
3

Wonder if also to build routines:
def foo = print A + B;

Then define a program:
:>edit add_numbers()
{
input A
input B
foo
}

Prompt:
:>run add_numbers()

Of course the option to delete them from memory
User avatar
dom
Well known member
Posts: 2076
Joined: Sun Jul 15, 2007 10:01 pm

Re: Creating a generic interpreter and memory management

Post by dom »

I don't think there's a C example. But from looking around at various home-brew hardware, the de-facto standard seems to be a variant of the Nascom flavour of Microsoft BASIC, eg here: https://github.com/feilipu/NASCOM_BASIC_4.7

It's easy to port to a new machine and add commands to allow interfacing with the serial ports etc
Post Reply