Z80 Assembler Recommendation

1,587 views
Skip to first unread message

Duncan Munro

unread,
Feb 14, 2021, 4:03:08 AM2/14/21
to RC2014-Z80
Hi, it's been 40 years or so since I did any assembly language for Z80, so.... looking for Z80 assembler recommendations. Have had a look through the history on here and nothing is jumping out at me - what are people using in 2021?

What I've looked at so far: On the target RC2014, I've been using Z80ASM by SLR, that seems to work quite well and the documentation is good.

My interest is leaning more to cross assembling from the Windows PC to the RC2014, I know it's not the same challenge, but... So far I've had a look at:

  • TASM - doesn't seem to like 64 bit Windows
  • Z88DK - documentation is good, but doesn't seem to work very well with the legacy CP/M source files I've been throwing at it (cbios128.asm, cpm22.asm etc.)
  • OshonSoftware Z80 simulator - have registered this one, has a built in assembler. Doesn't like the CP/M files either and the documentation for the built in assembler isn't great. The author suggests using the option of assembling TASM but when I point to the .exe I get Runtime Error 5 (see DOS vs. Windows 10 clash above)
Any suggestions gratefully received :)

Regards,
Duncan

Phillip Stevens

unread,
Feb 14, 2021, 5:04:24 AM2/14/21
to RC2014-Z80
Duncan wrote:
Hi, it's been 40 years or so since I did any assembly language for Z80, so.... looking for Z80 assembler recommendations. Have had a look through the history on here and nothing is jumping out at me - what are people using in 2021?
What I've looked at so far: On the target RC2014, I've been using Z80ASM by SLR, that seems to work quite well and the documentation is good.

My interest is leaning more to cross assembling from the Windows PC to the RC2014, I know it's not the same challenge, but... So far I've had a look at:
  • TASM - doesn't seem to like 64 bit Windows
You need TASM 3.2 with Windows. Wayne uses this for RomWBW, and it works fine. I'm not sure if you have to tweak the compatibility settings (like WinXP SP3 for example), but I can't remember needing to tweak it.
For interest, I like TASM 3.1 with DOSBOX on Linux. There are insignificant differences between the two versions in compiled outcom, it is simply one is 16-bit and the other is 32-bit.
  • Z88DK - documentation is good, but doesn't seem to work very well with the legacy CP/M source files I've been throwing at it (cbios128.asm, cpm22.asm etc.)
There's a bit of tweaking of the CP/M source files needed to work with the z88dk assembler. If you're interested you can check the CCP/BDOS and BIOS files ready to go in the RC2014 Repository, for either ACIA or SIO serial boards. That will give you a guide on what needs to be adapted to work with z88dk assembler.
  • OshonSoftware Z80 simulator - have registered this one, has a built in assembler. Doesn't like the CP/M files either and the documentation for the built in assembler isn't great. The author suggests using the option of assembling TASM but when I point to the .exe I get Runtime Error 5 (see DOS vs. Windows 10 clash above).
There. I didn't know this existed. And now I do.

My 2C,
Phillip 

jopil

unread,
Feb 14, 2021, 5:16:27 AM2/14/21
to RC2014-Z80
Hi Duncan,
You may also find useful, this on line source, 

Regards,
John

Douglas Miller

unread,
Feb 14, 2021, 7:38:54 AM2/14/21
to RC2014-Z80

I don't run Windows, but there claims to be a Windows version (there's an EXE in the zip).

S P Dixon

unread,
Feb 14, 2021, 7:42:33 AM2/14/21
to RC2014-Z80
Like Douglas, I'm not a Windows person but in case it helps anyone, I use zasm, which has a 'bundle' (plugin) for Textmate, so you get the syntax highlighting and a keystroke to assemble.

Wayne Hortensius

unread,
Feb 14, 2021, 2:57:45 PM2/14/21
to rc201...@googlegroups.com
Douglas Miller <durga...@gmail.com> wrote:

> I use zmac: http://48k.ca/zmac.html

I'll raise my hand for zmac as well. I use it on Linux and I can move
source between it and Al Hawley's zmac on CP/M (same name, different
assembler) with no modifications at all. That's a big plus for me.

Also, the source of the assembler is included and a one line
modification made its error reporting compatible with what Geany (a
lightweight IDE) expects so I can assemble in the editor and be taken
directly to any errors that occur. I've always liked that feature.

Regards,
Wayne

Baloo

unread,
Feb 14, 2021, 5:56:13 PM2/14/21
to RC2014-Z80

does cp/m cpme with an ASM compiler ?

Duncan Munro

unread,
Feb 14, 2021, 6:03:21 PM2/14/21
to RC2014-Z80
Thanks for the recommendations, much appreciated. I'll follow up on all of them over the coming week.

For this evening, I've tried zmac on Windows 10, works a treat. Compiles all the CP/M source files used for RC2014 with the exception of cpm22.asm which seems to throw up many hundreds of errors. Tracked it to line 1219 of cpm22.asm:

    BATCHFCB: .DB 0,

Surprisingly, the trailing comma on the end caused most other lines in the file to trigger a syntax error which made it a bit of a challenge to find.

Regards,
Duncan


Duncan Munro

unread,
Feb 15, 2021, 7:36:56 AM2/15/21
to RC2014-Z80


On Sunday, 14 February 2021 at 10:04:24 UTC Phillip Stevens wrote:
Duncan wrote:
  • Z88DK - documentation is good, but doesn't seem to work very well with the legacy CP/M source files I've been throwing at it (cbios128.asm, cpm22.asm etc.)
There's a bit of tweaking of the CP/M source files needed to work with the z88dk assembler. If you're interested you can check the CCP/BDOS and BIOS files ready to go in the RC2014 Repository, for either ACIA or SIO serial boards. That will give you a guide on what needs to be adapted to work with z88dk assembler.

Thanks for the link, I was looking in the wrong place prior to posting on here, originally at RC2014Z80 / RC2014 / CPM / SIO2 which had the RC2014 specific CP/M files that Z88DK didn't like. The EQU directives were causing the problem; I see Z88DK uses DEFC with EXTERN if needed instead of EQU. I'll take a look at this again as the approach looks a better bet for supporting larger projects, and also there is a C compiler which I could have some fun with too :)

Regards,
Duncan

Matt Balmer

unread,
Feb 25, 2021, 2:53:56 PM2/25/21
to RC2014-Z80
So, here is my question. I've read down the list in this thread, and I'm interested in learning Z80 assembler, but I'm curious to know which of these options would be a good place for someone who is new to it. 

The software I've had a little experience with is the Turbo Macro Pro assembler on the Commodore 64, which I know is a fully-integrated development environment, which if that exists for CP/M, would be amazing -- but I also am assuming that it likely doesn't. 

So, anything that has a friendly environment and runs directly on the RC2014 would be awesome, as I'd love to program on the unit itself.

Any ideas?

Jay Cotton

unread,
Feb 25, 2021, 7:40:35 PM2/25/21
to RC2014-Z80
I'll go out on a limb....

RMAC for the assembler, TE for the editor ZDDT for the debugger and LINK for the linker.
um RMAC does not seem to work with z80 syntax.  
http://www.cpm.z80.de/develop.htm  and look for zmac.  This seems to be the only
hope.  

I'm certain TE is not included on the RomWBW distro,  so you will have to hunt that down, 

jc

Phillip Stevens

unread,
Feb 25, 2021, 7:52:38 PM2/25/21
to RC2014-Z80
Mr Balmer wrote:
So, here is my question. I've read down the list in this thread, and I'm interested in learning Z80 assembler, but I'm curious to know which of these options would be a good place for someone who is new to it. 
So, anything that has a friendly environment and runs directly on the RC2014 would be awesome, as I'd love to program on the unit itself.

+1 for Jay's recommendation of TE for the editor.

For working on the RC2014, I find that the SLR pair of assemblers my favourite.
The main reason is that the SLR180 assembler supports Z180 opcodes in standard mnemonics, and therefore I can learn the same command line for all my machines.
Both SLR180 and Z80ASM can also generate REL files for use with the Microsoft LINK80 if desired (but completely optional).

I've attached the Z80ASM user manual. The CLI is pretty funky, but you get used to it.

P.


Z80ASM.PDF

Jay Cotton

unread,
Feb 25, 2021, 8:10:40 PM2/25/21
to RC2014-Z80

Richard Deane

unread,
Feb 26, 2021, 2:44:45 AM2/26/21
to rc201...@googlegroups.com
With SLR tools there is also a later plus version, where the linker is especially handy as it uses disk as work space rather than tpa so can link larger or more complex programs. If anyone has problems finding it let me know and I can email an LBR file of it.

Richard

--
You received this message because you are subscribed to the Google Groups "RC2014-Z80" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rc2014-z80+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rc2014-z80/88037029-0b1e-4b44-9955-00fb60f9beben%40googlegroups.com.

Phillip Stevens

unread,
Feb 26, 2021, 4:38:30 AM2/26/21
to RC2014-Z80
Richard wrote:
With SLR tools there is also a later plus version, where the linker is especially handy as it uses disk as work space rather than tpa so can link larger or more complex programs.

The latest the net has is v1.3x. Is that the right version for z80asm, slr180 and slrnk? 
 
If anyone has problems finding it let me know and I can email an LBR file of it.

If there's something later / greater, I would be pleased to receive a copy.

Cheers, Phillip

Andrzej Borsuk

unread,
Feb 26, 2021, 1:44:43 PM2/26/21
to RC2014-Z80
I would recommend A.E. Hawley ZMAC, mentioned here before, as an alternative to z80asm
It's very simmilar to SLR tools and I think it's good to have them both.

ZMAC supports Z80, Z180 and HD64180 instruction set. It cames with excellent 120 page docummentation in WordStar format, and help files describing z80 instruction set.
If somebody is interested, I have created PDF version of manual as an exersise.

btw. With a little tinkering, you can persuade Linux to support CP/M executables (I mean full integration including path search, io redirection, and filesystem access)

Regards,
Andrzej

Phillip Stevens

unread,
Feb 28, 2021, 10:04:13 PM2/28/21
to RC2014-Z80
Richard wrote:
With SLR tools there is also a later plus version, where the linker is especially handy as it uses disk as work space rather than tpa so can link larger or more complex programs.

With thanks to Richard (and Mr Maslin), I've put a collection of SLR Tools together, here, in the RC2014 Github.
The file is zipped, and can be read on modern systems with cpmtools.

SLRMAC is the Intel mnemonics version of Z80ASM which uses Zilog mnemonics, which I did not know existed.

For the record of what's on the drive, and the release versions...

D>a:ddir

-- Directory of volume #3 --
180FIG.COM     .........3840
CONFIG.COM     .........3968
CONFIGP.COM    .........5632
ED80INST.COM   ........18944
ED80INST.REL   ........21760
ED80INST.Z80   .......111872
LNKFIG.COM     .........1792
MAKESYM.COM    .........1152
MAKESYM.DOC    .........1920
NZLNKFIX.ZEX   .........1024
README.LNK     .........2432
S8.COM         ........25216
SLR180.COM     ........25216
SLR180.DOC     .........2432
SLRIB.COM      .........3968
SLR.IRV        .........1664
SLRMAC.COM     ........25216
SLRNK1.COM     .........8704
SLRNK.COM      .........8704
SLRNKFIX.ZEX   .........1024
SLRNK+.COM     ........20224
SLRZ80+.COM    ........31744
SYNTAX.HLP     .........8064
SYSSLR.REL     ........23040
VSLR.REL       .........1664
Z3SLR.REL      .........9600
Z80ASM+.COM    ........31744
Z80ASM.COM     ........25088
Z80ASM.DOC     .........2816
Z80ASM-.MSG    .........1408
Z8-NEW.IRV     ..........384
Total bytes: 432256.

D>slrnk
SuperLinker Copyright (C) 1983-86 by SLR Systems Release 1.31 #AB1234

D>slrnk+
SLRNK+ Copyright (C) 1985-86 by SLR Systems Rel. 2.02 #J10154

D>s8
SLRMAC Copyright (C) 1985-86 by SLR Systems Rel. 1.32 #K10096

D>z80asm
Z80ASM Copyright (C) 1983-86 by SLR Systems Rel. 1.32 #AB1234

D>z80asm+
Z80ASM PLUS Copyright (C) 1985-86 by SLR Systems Rel. 1.12 #L10068

D>slr180
SLR180 Copyright (C) 1985-86 by SLR Systems Rel. 1.31 #AB1234


Matt Balmer

unread,
Mar 7, 2021, 4:47:47 PM3/7/21
to RC2014-Z80

With thanks to Richard (and Mr Maslin), I've put a collection of SLR Tools together, here, in the RC2014 Github.
The file is zipped, and can be read on modern systems with cpmtools.


I'm sorry, but I'm kinda new at this. How exactly do I get these files onto the CF card on the RC2014? It looks like this is an entire "drive" in CP/M terms, and I have no idea how to actually make use of the files you've put up there. 

Phillip Stevens

unread,
Mar 7, 2021, 8:05:40 PM3/7/21
to RC2014-Z80
 Phillip wrote:
With thanks to Richard (and Mr Maslin), I've put a collection of SLR Tools together, here, in the RC2014 Github.
The file is zipped, and can be read on modern systems with cpmtools.

Mr Balmer wrote: 
I'm sorry, but I'm kinda new at this. How exactly do I get these files onto the CF card on the RC2014? It looks like this is an entire "drive" in CP/M terms, and I have no idea how to actually make use of the files you've put up there. 

First thing you need to do is to get cpmtools running on your modern PC of choice. There are debian (Ubuntu) versions available with apt install cpmtools or other Linux versions from here for example.
If you want to have a Windows version, you can try here at Wild Turkey.

Once cpmtools is running on your modern PC, then you can provide the drive descriptor used for CP/M-IDE. The contents of the /etc/cpmtools/diskdefs file need to be updated to include the specific to the file format calculations I've used.
This is also covered here.

diskdef rc2014-8MB
 seclen 512
 tracks 64
 sectrk 256
 blocksize 4096
 maxdir 2048
 skew 0
 boottrk -
 os 2.2
end

Ok, now you have access to CP/M formatted drives from your modern PC.

So unzip the SLR Tools CP/M drive, and just  copy the contents of each "drive" file into a new directory on your PC. For example.
> cpmls -f rc2014-8MB SLRTOOL.CPM
> cpmcp -f rc2014-8MB SLRTOOL.CPM  0:*  ~/SLRTOOL/*

Next step you have to get these files from your PC over to the RC2014.

If you are using the standard Searle CP/M, then you can use xmodem or pip to copy the files over using the serial interface.

If you are using RomWBW, then there is a utility called FAT.COM that Wayne wrote to move files from the FATFS formatted part of a CF card to the slices (drives) of CP/M on the same CF card.
It is usually available on the RomWBW system drive.

And finally, if you're using CP/M-IDE, then just connect and mount your RC2014  CF card or PATA drive  on your modern PC, and drag the original "drive" file into the drive.
And then when you boot CP/M from the shell just include the new "drive" file as one of your drives.

RC2014 CP/M-IDE
feilipu 2021

> :-)

> cpm sys.cpm slrtool.cpm user.cpm user2.cpm
Opening "sys.cpm" at LBA 149384
Opening "slrtool.cpm" at LBA 280456
Opening "user.cpm" at LBA 198536
Opening "user2.cpm" at LBA 214920
Initialised CP/M

A>b:
B>dir

B: 180FIG   COM : CONFIG   COM : LNKFIG   COM : MAKESYM  COM
B: MAKESYM  DOC : NZLNKFIX ZEX : README   LNK : SLR180   COM
B: SLR180   DOC : SLRIB    COM : SLRNK1   COM : SLRNK    COM
B: SLRNKFIX ZEX : SYNTAX   HLP : SYSSLR   REL : VSLR     REL
B: Z3SLR    REL : Z80ASM   COM : Z80ASM   DOC
B>

That's it.

Reply all
Reply to author
Forward
0 new messages