first attempt using Boriel’s ZX-Basic Compiler

Any discussions related to the creation of new hardware or software for the ZX80 or ZX81
Post Reply
User avatar
nitrofurano
Posts: 24
Joined: Fri May 09, 2014 5:18 pm
Contact:

first attempt using Boriel’s ZX-Basic Compiler

Post by nitrofurano »

After trying to extend Boriel’s ZX-Basic Compiler to other z80-based hardware, like game consoles, other home computers, and some arcade machines, finally i tried to start to target ZX81 from it: http://www.boriel.com/wiki/en/index.php ... ams_-_ZX81

And since i think there are no cross-compilers of basic language for zx81, i guess this one might be useful for some people here, like me?

I actually tried to start from some assembly examples posted here in this forum, but i really don't know what i might be doing wrong there for not acquiring an expected result - perhaps i'm misaccessing the stack and whole ram area (specially when Boriel’s ZX-Basic Compiler uses ix register a lot for functions and routines)? perhaps misusing the bios routines?

each and any help would be amazing there, and thanks a lot in advance! :)
User avatar
PokeMon
Posts: 2264
Joined: Sat Sep 17, 2011 6:48 pm

Re: first attempt using Boriel’s ZX-Basic Compiler

Post by PokeMon »

What should someone answer with just a screenshot but no data/source/binary ?
What do you want to program exactly ?
BASIC, Assembler ?

You could try the IDE here, allowing BASIC and Assembly and offering a simple framework (ZX81DEMO.ASM).
viewtopic.php?f=6&t=1064
Boriels site state that ZX BASIC is for ZX Spectrum which is much different to a ZX81.
sirmorris
Posts: 2811
Joined: Thu May 08, 2008 5:45 pm

Re: first attempt using Boriel’s ZX-Basic Compiler

Post by sirmorris »

Especially as IX and IY registers are out of bounds for casual code. In order to use these registers special care must be taken, care which extends to writing your own display routines :?
User avatar
Andy Rea
Posts: 1606
Joined: Fri May 09, 2008 2:48 pm
Location: Planet Earth
Contact:

Re: first attempt using Boriel’s ZX-Basic Compiler

Post by Andy Rea »

And also the alternative af pair, which is also used for display generation, i often wonder if the rom could be made smaller/faster if these restrictions on register usage were not present...

Regards Andy
what's that Smell.... smells like fresh flux and solder fumes...
nollkolltroll
Posts: 325
Joined: Sat Sep 27, 2014 8:02 pm
Location: Stockholm, Sweden

Re: first attempt using Boriel’s ZX-Basic Compiler

Post by nollkolltroll »

Andy I think that having the possibility to choose between integers and floats could speed up most BASIC programs considerably.
/Adam
User avatar
stefano
Posts: 574
Joined: Tue Dec 11, 2012 9:24 am
Contact:

Re: first attempt using Boriel’s ZX-Basic Compiler

Post by stefano »

I think that the FP calculator approach (probably coming from the real Sinclair calculator) is the biggest space saver.
This together with a clever RST mapping and reusing the memory management routines squeezed the code incredibly.
The other BASIC implementations smaller than 4K I could see (the Microsoft's 4K one od the Dunfield's 3K BASIC dialect for the 8085 computer) are much, much, weaker.

[EDIT] Wow, what a mistake :oops: ..actually the zx81 ROM is 8k !
User avatar
nitrofurano
Posts: 24
Joined: Fri May 09, 2014 5:18 pm
Contact:

Re: first attempt using Boriel’s ZX-Basic Compiler

Post by nitrofurano »

PokeMon wrote:What should someone answer with just a screenshot but no data/source/binary ?
What do you want to program exactly ?
BASIC, Assembler ?
both, as you see from http://www.boriel.com/wiki/en/index.php ... R_HARDWARE - you can have inlline assembly in the basic code, generate assembly from basic, compile to binary, etc.
You could try the IDE here, allowing BASIC and Assembly and offering a simple framework (ZX81DEMO.ASM).
viewtopic.php?f=6&t=1064
Boriels site state that ZX BASIC is for ZX Spectrum which is much different to a ZX81.
see the non-zxspectrum machines i used Boriles at http://www.boriel.com/wiki/en/index.php ... R_HARDWARE - even arcade machines! - the 2 game entries i submitted to the last Karoshi's MSXDev for msx1 were made on Boriels, and i made ports to colecovision and sega sg1000 from it simultaneously

so i guess that, somehow, i can create .p files from Boriels as simply as i can for these machines since they are z80-based as well?

i can imagine it's not that impossible that, if we can code something for zx81 via Pasmo, we also can via Boriels
User avatar
nitrofurano
Posts: 24
Joined: Fri May 09, 2014 5:18 pm
Contact:

Re: first attempt using Boriel’s ZX-Basic Compiler

Post by nitrofurano »

would be great if there were some examples compilable via Pasmo or any other cross-assembler that runs fine on gnu/linux - and i'm not that comfortable with ides, i prefer using terminal with text editor combined - i believe that i can adapt Pasmo .asm examples into Boriels, and then starting to have some progressions like adding some libraries - using rom routines would be great (i'm actually concerned about zx80/zx81/clones differences, and the ix/iy/stack issue often used on Boriels' functions/routines)
Post Reply