Page 1 of 2

Expanding ZX BASIC for more commands?

Posted: Mon Dec 02, 2013 7:18 pm
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

Re: Expanding ZX BASIC for more commands?

Posted: Mon Dec 02, 2013 9:05 pm
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/

Re: Expanding ZX BASIC for more commands?

Posted: Mon Dec 02, 2013 9:28 pm
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

Re: Expanding ZX BASIC for more commands?

Posted: Mon Dec 02, 2013 11:21 pm
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.

Re: Expanding ZX BASIC for more commands?

Posted: Mon Dec 02, 2013 11:29 pm
by 1024MAK
Don't forget that ZXpand overlays its own ROM...

Mark

Re: Expanding ZX BASIC for more commands?

Posted: Mon Dec 02, 2013 11:41 pm
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.

Re: Expanding ZX BASIC for more commands?

Posted: Mon Dec 02, 2013 11:52 pm
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 4005 times

Re: Expanding ZX BASIC for more commands?

Posted: Tue Dec 03, 2013 12:15 am
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

Re: Expanding ZX BASIC for more commands?

Posted: Tue Dec 03, 2013 12:37 am
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. :?

Re: Expanding ZX BASIC for more commands?

Posted: Tue Dec 03, 2013 10:03 am
by RWAP
You could always try disabling the ZXpand ROM after loading with the command:

LOAD "PB12K.P;X"

to load the new BASIC.