Homemade Assembler I wrote in mid 80s

Discussion about ZX80 / ZX81 Software
Post Reply
bwinkel67
Posts: 150
Joined: Mon Mar 23, 2020 2:38 am

Homemade Assembler I wrote in mid 80s

Post by bwinkel67 »

[Had posted this incorrectly under Lambda 8300]

Hi all,

I was finally able to recover an assembler I wrote back in the mid 80s as a kid on my US ZX81. Being a young whipper snapper, of course I didn't document it so I've been trying to recollect how it works by reading through the code. I'm doing a video on it which I'll post here when done.

I've seen two other Assemblers so far, one by Bug Byte and one by Cinagro Software (I'm sure there are others). Both seem to load a machine code routine into memory and then you can load your assembly (similar to how MCODER does it)...which is likely preferred to my method which slaps about 8K of BASIC after the assembly (though there is a NEW command that can remove the BASIC assembler for you).

It has a few idiosyncrasies, like having to differentiate a 2-byte vs 3-byte LD instruction by affixing a + in front of it (I guess I was too lazy to figure it out in another way). It also supports labels, as well as support for relocating code with a label, i.e. START = 16544 would do that...and also lets you piece together multiple smaller bits by basically assembling code, erasing the assembly (viea ERASE) and then creating the next module...that's a way to deal with the memory limitations of having to drag around 8K of BASIC.

This is 100% written in BASIC, with the exception of two routines that are loaded from data (string of numbers) that a) increase the size of the REM via DIM and b) remove the entire BASIC or just the Assembly (NEW and ERASE). I will have to spend some time seeing what all you can do with it. I think it supports most Z80 instructions, and the ones it doesn't, you can enter via the DATA statement. Once debugged, then I need to think about writing a guide for it (or maybe the video I create will be that) before distributing it to the general public.

Here are some screenshots, with the first two showing what it looks like after running the program with the associates assembly:

Loop.png
Loop.png (82.44 KiB) Viewed 214 times
Simple loop (note the +LD) that changes first character in 1 REM statement after it executes (run via RAND USR 16516, skipping first two bytes).
Graphic.png
Graphic.png (80.49 KiB) Viewed 214 times
I got this program from a YouTube video of someone demoing the Bug Byte assembler.

Instr_1.png
Instr_1.png (89.58 KiB) Viewed 214 times
Instr_2.png
Instr_2.png (92.23 KiB) Viewed 214 times
Here are two screens showing all the commands it supports.
Post Reply