Expanding ZX BASIC for more commands?

Anything Sinclair ZX Basic related; history, development, tips - differences between BASIC on the ZX80 and ZX81
tdg8934
Posts: 304
Joined: Mon Sep 23, 2013 6:10 pm

Expanding ZX BASIC for more commands?

Post by tdg8934 »

Has anyone been successful in expanding the ROM for additional BASIC commands? I know the ZXPand replaced some so I don't know how possible it might be. I would like to see READ and DATA statements and some of the other common BASIC commands.

Tim
User avatar
PokeMon
Posts: 2264
Joined: Sat Sep 17, 2011 6:48 pm

Re: Expanding ZX BASIC for more commands?

Post by PokeMon »

Yes, a guy of the german board did this in the past, called POWER BASIC for ZX81. 8-)
http://www.swatosch.de/zx81/
tdg8934
Posts: 304
Joined: Mon Sep 23, 2013 6:10 pm

Re: Expanding ZX BASIC for more commands?

Post by tdg8934 »

I like this a lot and I see these new commands.

HELP
STATUS
TRACEON
TRACEOFF
STEPON
STEPOFF
DATA D1[, D2, D3, .. Dn]
RESTORE [line]
READ var
IN var, port
OUT port, value
ONERROR line
ERROR errornumber

I will check this out tonight.

Tim
tdg8934
Posts: 304
Joined: Mon Sep 23, 2013 6:10 pm

Re: Expanding ZX BASIC for more commands?

Post by tdg8934 »

It doesn't seem to want to play well with the ZXPand/ZXPand-AY. I tried PB32K.P and PB16K.P and weird stuff is happening. My ZXVid also started to get pretty dark in one of my TS1000 so I'll have to check that out. Im sure it's unrelated to the ZXVid.

EDITED: Fixed the ZXVid (slightly loose). Bright white background now.
Last edited by tdg8934 on Mon Dec 02, 2013 11:31 pm, edited 1 time in total.
User avatar
1024MAK
Posts: 5101
Joined: Mon Sep 26, 2011 10:56 am
Location: Looking forward to summer in Somerset, UK...

Re: Expanding ZX BASIC for more commands?

Post by 1024MAK »

Don't forget that ZXpand overlays its own ROM...

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.
tdg8934
Posts: 304
Joined: Mon Sep 23, 2013 6:10 pm

Re: Expanding ZX BASIC for more commands?

Post by tdg8934 »

Has anyone tried this with the ZXPand?

I'll keep looking at it some more tonight and describe what I am seeing. The name PB32K.P is a little misleading as it does not work with 32K but as the manual states it runs ABOVE 32K. I should be using one of the other variants such as PB8K.P or PB12K.P which runs above the ZX81 BASIC ROM 8K and leaves 16K available for programs. The PB16K runs in the upper ~4K part of 16-32K RAM and adjusts RAMTOP and leaves about 12K free.
User avatar
PokeMon
Posts: 2264
Joined: Sat Sep 17, 2011 6:48 pm

Re: Expanding ZX BASIC for more commands?

Post by PokeMon »

You should read the documentation.
It is well described which version to use or which version need memory in which area. ;)
If you want to use 32k version you need the M1NOT circuit modification to run assembler code in this area. Without this modification this area can be used for data only as program execution is affected by the ULA video circuit which feeds the CPU with NOP when A15 is high.
Clipboard04.jpg
Clipboard04.jpg (41.62 KiB) Viewed 3974 times
tdg8934
Posts: 304
Joined: Mon Sep 23, 2013 6:10 pm

Re: Expanding ZX BASIC for more commands?

Post by tdg8934 »

Thanks PokeMon. That's where I got my information I posted but I thought the naming of the file could have been better but it is what it is - which is ok now that I have seen the chart. No problems. However, none of the versions will run with the ZXPAND connected. Using the CAT command for example causes cursor inverse flashing at the very least. Some versions like PB16K.P cause screen rolling at a slant and all variations are really unusable from what I can tell when using with the ZXPAND.

Tim
User avatar
PokeMon
Posts: 2264
Joined: Sat Sep 17, 2011 6:48 pm

Re: Expanding ZX BASIC for more commands?

Post by PokeMon »

Well that are maybe restrictions from ZXpand - so see the manual of ZXpand.
I think it's working fine on usual ZX81 without problems. ;)
It is using ZX81 ROM routines I think which can be problematic when using the ZXpand.
But as the source code is provided on this homepage as well, you can maybe modify it.

Code: Select all

Rom routines used:
       7:  00:4009  (00:0F23)           ROM_SetFast             equ     0x0F23
       8:  00:4009  (00:0F2B)           ROM_SetSlow             equ     0x0F2B
       9:  00:4009  (00:02E7)           ROM_SetFast2            equ     0x02E7
      10:  00:4009  (00:0207)           ROM_SlowFast            equ     0x0207
      11:  00:4009  (00:151D)           ROM_PutIntoStack        equ     0x151D
      12:  00:4009  (00:1520)           ROM_PutIntoStack2       equ     0x1520
      13:  00:4009  (00:158A)           ROM_GetResultInBC       equ     0x158A
      14:  00:4009  (00:0F46)           ROM_Break               equ     0x0F46
Maybe you ask SirMorris if some of these routines have been moved or removed. :?
RWAP
Posts: 1348
Joined: Thu May 08, 2008 8:42 am
Location: Stoke-on-Trent, UK
Contact:

Re: Expanding ZX BASIC for more commands?

Post by RWAP »

You could always try disabling the ZXpand ROM after loading with the command:

LOAD "PB12K.P;X"

to load the new BASIC.
Post Reply