Template to jumpstart ZX81 assembler developments

Any discussions related to the creation of new hardware or software for the ZX80 or ZX81
Post Reply
User avatar
marste
Posts: 279
Joined: Sun Aug 10, 2014 9:58 pm
Location: Italy
Contact:

Template to jumpstart ZX81 assembler developments

Post by marste »

VSCode with DeZog extension is a wonderful modern development environment for ZX81, but is not trivial to configure it.

To jumpstart I created a simple "hello world" template repository with all the configurations and instructions. Simply download or fork it and start creating code!

You can find it here: ZX81 DeZog & SjAsmPlus Template

Open for comments and suggestions for improvements!

PS: "star" it if you like it! :)
abacaxi
Posts: 17
Joined: Thu Dec 05, 2024 8:20 pm

Re: Template to jumpstart ZX81 assembler developments

Post by abacaxi »

Nice, I'm curious why there's s nop at 4009 before the JP, in beeps template that you also link to it's just a jp. Something with line numbers and length for the following basic I presume? I'm an experienced z80 programmet but I'm new to the zeddy. Trying to learn how the boot/load sequence works. Much easier on the spectrum where you can load the machine code separately to whatever address you like.
dr beep
Posts: 2428
Joined: Thu Jun 16, 2011 8:35 am
Location: Boxmeer

Re: Template to jumpstart ZX81 assembler developments

Post by dr beep »

abacaxi wrote: Sun Mar 23, 2025 3:35 pm Nice, I'm curious why there's s nop at 4009 before the JP, in beeps template that you also link to it's just a jp. Something with line numbers and length for the following basic I presume? I'm an experienced z80 programmet but I'm new to the zeddy. Trying to learn how the boot/load sequence works. Much easier on the spectrum where you can load the machine code separately to whatever address you like.
The NOP JP MAIN is part of the BASIC-line that is executed.
The 4 bytes together form a fake linenumber and fake length.
A linenumber in BASIC is not allowed to be larger than 9999, The NOP and the JP together form linenumber 195 (MSB first).
The address of the JP is the fake linelength.

After loading the ZX81 will start the BASIC indicated by NXTLIN. That BASIC-line does a PRINT USR number to the code that forms the
linenumber and the JP. Since all code is done over the systemvariables you can;t load the code without autostart and edit on a zx81 itself.

To make a link to the ZX Spectrum:
During the MINIGAMECOMPO's around 2006-2010 the size on tape counted. Also the start of the program.
On a ZX Spectrum a same trick is developed to store info in a fake linenumber and size. When making the shortest loader on a ZX81
I simply tried the same trick on the ZX81.
abacaxi
Posts: 17
Joined: Thu Dec 05, 2024 8:20 pm

Re: Template to jumpstart ZX81 assembler developments

Post by abacaxi »

dr beep wrote: Sun Mar 23, 2025 3:48 pmThe NOP JP MAIN is part of the BASIC-line that is executed.
The 4 bytes together form a fake linenumber and fake length.
I see it now, your loader has the ld h and jr instead which is also four bytes, then you reset the dfile pointer further down, whereas this loader sets dfile in the main routine. How does a traditional header look? The old school one with machine code in REM? It's kind of weird that the first machine code I've ever written on the zx81 is based on a very intricate hack invented in the 21st century. :D
dr beep
Posts: 2428
Joined: Thu Jun 16, 2011 8:35 am
Location: Boxmeer

Re: Template to jumpstart ZX81 assembler developments

Post by dr beep »

The traditional loader has some pointers here, like sysvar on the zx spectrum at 23552, then a printerbuffer and then a rem line for the machinecode and a line with the print usr line.

On a 1K ZX81 you would have around 50 bytes overhead lost.

If you want I can add the old setup with the overhead.
User avatar
marste
Posts: 279
Joined: Sun Aug 10, 2014 9:58 pm
Location: Italy
Contact:

Re: Template to jumpstart ZX81 assembler developments

Post by marste »

Just to add that the template has been integrated to support "github codespaces" that allow the full development completely inside the browser, really jumpstarting, without the need to install anything, and be able to use it everywhere!
Post Reply