A new Z80 assembler, compatible with the HiTech C compiler, ZAS assembler and LINK linker

Z80AS is a new macro-assembler for Z80 microcomputers, running on the CP/M operating system.

See https://github.com/Laci1953/Z80AS

It runs on Z80-based computers, assembles Z80 source code and is compatible with the HiTech C compiler, ZAS assembler and LINK linker.

The main target of this project was to obtain an assembler compatible with ZAS, the assembler that is used by the HiTech C Compiler, but superior as performance.

The biggest ZAS problem is related to its size (38KB), and because of this ZAS is unable to assemble large source files (too small free space remains for the symbols).

Z80AS’s size is only 24KB, that means 14KB more memory is available to store the symbols, compared to ZAS.

For example, ZAS fails to assemble the CP/M BDOS source. In contrast, Z80AS succeeds to assemble even a larger file, the CP/M BDOS and BIOS, concatenated.

Often, using HiTech’s C compiler to compile large C files is not possible because ZAS fails to assemble the intermediate file produced by the compiler (“out of memory” error message).

Z80AS is compatible with HiTech’s ZAS and produces object files compatible with HiTech’s LINK linker.

Therefore, by using the -S option (to output the corresponding assembly file) when compiling a C source file, we can assemble the output with Z80AS, avoiding the “out of memory” error, then we can link the object file with the C library files to obtain the final .COM file.

Compared to HiTech’s ZAS assembler, Z80AS has some advantages:

  • can compile larger source files
  • supports the undocumented Z80 instructions
  • has more pseude operators (coonditionals, listing control)
  • better MACRO facilities (REPT,IRP,IRPC,LOCAL)
  • better support for expression evaluation, including extensive use of parantheses and well-defined operator precedence

regards,
Ladislau

4 Likes

Sounds very good - well done, and thanks for sharing!