Download Latest Version str_z80.tar.bz2 (136.3 kB)
Email in envelope

Get an email when there's a new version of str_z80

Home
Name Modified Size InfoDownloads / Week
str_z80.tar.bz2 2026-03-01 136.3 kB
readme.txt 2026-02-04 972 Bytes
Totals: 2 Items   137.3 kB 0
str_z80 is a preprocessor written in C.
It allows structured programmation in assembler.

See test2.z80 for examples of use.

This program was originally written in Awk for supporting the 8051. 
It was ported for the Z80, still in Awk.

This version is written in C, supporting the same macros. 
It can be easily ported to other microprocessors/microcontrollers.

Some differences from the Awk version.

Awk			C
_case(Reg,)		_case(Reg)		case without mask
_case(Reg,Mask)		no change

_break			_sw_break, _do_break, _while_break


How it works
------------

A 1st state machine separate the label, the instruction or macros, the comment sections.
See procline.c for the code.

A 2nd state machine separate the macro and its arguments.
See procmac.c for the code.

finally, the macro is parsed and implemented.
See procmac2.c for the code.

To port the code to another CPU, see macros.c


Notes
-----
We can do comparison with register pairs. See example at end of Test2.z80.
Source: readme.txt, updated 2026-02-04