Setting up an eprom with coral basic interpreter

Any discussions related to the creation of new hardware or software for the ZX80 or ZX81
User avatar
xubuntu
Posts: 84
Joined: Sat Jun 18, 2022 12:42 pm
Location: Athens, GR

Setting up an eprom with coral basic interpreter

Post by xubuntu »

Hi

Here we have a lovely version of basic interpreter in p format.

https://zxart.ee/eng/software/tool/prog ... terpreter/

So the goal is to place it on an eprom and boot it up without stroking any keys.

It certainly requires the basic rom's routines.

First things first.

How do we turn the p file into machine code?

Then we get an eprom of let's 64kb or bigger, and flash inside at 0000 the original zx81 rom.

Then at some point, at address 27400 let's say, we flash the contents of coral basic.

The way you run coral basic p file is by making space on ramtop.

Code: Select all

POKE 16388,8
POKE 16389,107
NEW
Then you load and run by calling address 27400.

Code: Select all

RAND USR 27400
So how do we do all that on an eprom?

How do we do automatic spacing / paging, how do we automatically use the "rand usr command", how do we fit zx basic AND coral basic on the same eprom, how do we read 64kb ?

I am here to sparkle some enthusiasm. :roll:
User avatar
mrtinb
Posts: 1911
Joined: Fri Nov 06, 2015 5:44 pm
Location: Denmark
Contact:

Re: Setting up an eprom with coral basic interpreter

Post by mrtinb »

I think this topic is what you need for your experiment.

viewtopic.php?p=46092#p46092
Martin
https://zx.rtin.be
ZX81, Lambda 8300, Commodore 64, Mac G4 Cube
User avatar
1024MAK
Posts: 5118
Joined: Mon Sep 26, 2011 10:56 am
Location: Looking forward to summer in Somerset, UK...

Re: Setting up an eprom with coral basic interpreter

Post by 1024MAK »

What is being asked may sound simple…

What area does that version of BASIC use for its various workspaces? If it was designed to run from RAM, they could be using anywhere in the space it is located in. If put into EPROM, any workspace that ends up in ROM will obviously not work correctly.

Next problem, is the code written to be relocatable? If not, how many references are are there to absolute addresses that will need to be changed, such as CALL, JMP as well as LD or other similar machine code instructions.

Mark
ZX81 Variations
ZX81 Chip Pin-outs
ZX81 Video Transistor Buffer Amp

:!: Standby alert :!:
There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :!:
Looking forward to summer later in the year.
User avatar
xubuntu
Posts: 84
Joined: Sat Jun 18, 2022 12:42 pm
Location: Athens, GR

Re: Setting up an eprom with coral basic interpreter

Post by xubuntu »

If it was simple I wouldn't be asking here, I would do it alone.

Yes it was designed to run from ram, obviously.

The program runs with either 16 or 32kb of ram. Doesn't that answer our question and make it relocatable ?

I believe there is a way to move all contents of rom into ram and load it from there.

zx81 basic rom will still be located on the first 8k of our eprom.

The next 16k that includes our program (coral basic) will be copied to ram and hopefully occupy the addresses that would occupy if the program was loaded normally.

Also, in case it's not relocatable, Instead of changing the absolute jumps etc, we could just use the correct size eprom, that would act as if program was loaded normally.

Of course, all I say could be complete nonsense as I am totally new to the way this computer operates.
User avatar
kmurta
Posts: 305
Joined: Tue Sep 01, 2009 5:04 am
Location: Belo Horizonte - BR
Contact:

Re: Setting up an eprom with coral basic interpreter

Post by kmurta »

1024MAK wrote: Sun Oct 30, 2022 7:05 pm is the code written to be relocatable?
Yes, CBI is relocatable, use the CBI-REL.P program for that.

It is possible to relocate CBI to address 8192 and then write an 8Kb EPROM mapped to that address.
cbirel.png
cbirel.png (4.17 KiB) Viewed 9226 times
1 x ZX81, 2 x TK85 , 1 TK82C, 1 TK95, 1 x Alphacom 32 printer, 1 x ZXpand
ZeXtender board, Joy81 - Programmable Joystick Controller, Turbo Sound 81
http://zx81.eu5.org
https://toddysoftware.itch.io/
User avatar
xubuntu
Posts: 84
Joined: Sat Jun 18, 2022 12:42 pm
Location: Athens, GR

Re: Setting up an eprom with coral basic interpreter

Post by xubuntu »

So you mean the 8k eprom will not have the original rom but only coral basic ?

You mean, it is not necessary to include the original rom ?

How do I run the CBI-REL.p program? If I run it all alone I get the message "CBI VS 7 NOT IN RAM".

If I load CBI first and then try to open it through coral, it still doesn't open, the screen keeps flickering.

And then let's say that I managed to successfully run it and relocate CBI, all that are still in ram.

How do I get them out of ram and into an eprom chip ?
User avatar
xubuntu
Posts: 84
Joined: Sat Jun 18, 2022 12:42 pm
Location: Athens, GR

Re: Setting up an eprom with coral basic interpreter

Post by xubuntu »

Could someone help with this? I 've been thinking about it since yesterday.

How does this program load up? CBI needs to be loaded first, right ?

Let's say we load it, run it and change some values in CBI.p. I guess those changes will be in memory, right? The only way to get them out of memory is with the "save" command, right?

And then we will have saved a p file. How do we go from a p file to a bin file in order to flash the rom ?
User avatar
kmurta
Posts: 305
Joined: Tue Sep 01, 2009 5:04 am
Location: Belo Horizonte - BR
Contact:

Re: Setting up an eprom with coral basic interpreter

Post by kmurta »

Hi friend, sorry for the delay, unfortunately real life is hard and I don't have all the time I would like to dedicate to the ZX81, but I will try to help you.

First set RAMTOP to address 27400:

POKE 16388,8
POKE 16389,107
NEW

and loads the CBI.P, then loads the CBI-REL.P, set the destination address (8192 in this case) and the address of the system variables. For 16Kb of RAM I advise leaving the current value, 32730.

To generate the .bin file use the EightyOne emulator, File menu, 'Save memory Block' option, define the name, inform the starting address (8192) and the size, 5330 and press 'OK'. Or use ZXpand's SAVE command:

SAVE "CBI.BIN;8192,5330"

If you intend to deploy the new ROM internally on the ZX81, it might be better to use a 16Kb EPROM with the O.S. and CBI written on it, this will simplify the installation as you only need to reroute a few signals.

I hope this helps you.
1 x ZX81, 2 x TK85 , 1 TK82C, 1 TK95, 1 x Alphacom 32 printer, 1 x ZXpand
ZeXtender board, Joy81 - Programmable Joystick Controller, Turbo Sound 81
http://zx81.eu5.org
https://toddysoftware.itch.io/
User avatar
XavSnap
Posts: 1941
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: Setting up an eprom with coral basic interpreter

Post by XavSnap »

Hi,

Something's steel wrong with the prompt...
No an inverted character.
And crash on EO.
CBI_@8192.zip
(4.16 KiB) Downloaded 284 times
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
User avatar
Paul
Posts: 1517
Joined: Thu May 27, 2010 8:15 am
Location: Germanys west end

Re: Setting up an eprom with coral basic interpreter

Post by Paul »

I made my own version on EO1.29 which works.
Of course zxpand has to be off
In theory, there is no difference between theory and practice. But, in practice, there is.
Post Reply