Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using ZX Basic to create ESXDOS dot commands
#2
After some investigation, I wil reply myself here for others that may read this later:

It's not easy to build an ESXDOS command using ZX Basic, cause of two reasons:

1) Max length for an ESXDOS command is about 8K. Unless you have a very simple program, it's easy that once the compiler libraries are added you don't have too much room for your own code.
2) When an ESXDOS command is executing, the ESXDOS ROM is active, not the Spectrum ROM. Thus, most calls from Boriel basic to ROM would lead to some kind of issue (freezing, reseting, etc.), including RST calls.

There is a way to call to ROM from ESXDOS commands, that forces standard ROM mapping on call and again ESXDOS mapping on return, but of course no ZX Basic call is doing that, and I guess changing it it's quite complicated.

I've found a walkaround though, not the bes solution but it works:

1) Compile ZX-Basic program to BIN (raw) code, with ORG somewhere in the RAM
2) Make your ESXDOS command be an assembler prorgama (not ZX Basic, pure assembler) that loads the bin file into upper RAM, and then calls the code using the EXDOS ROM unmap funcion:

Code:
RST $18
DW <ORG address>
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)