Menu

Tree [ad6583] master /
 History

HTTPS access


File Date Author Commit
 Makefile 2026-02-04 jpellet jpellet [28d16d] Initial commit
 common.h 2026-02-04 jpellet jpellet [28d16d] Initial commit
 cond.c 2026-03-01 jpellet jpellet [ad6583] Corrected the ending line being doubled
 cond.h 2026-02-04 jpellet jpellet [28d16d] Initial commit
 config.h 2026-03-01 jpellet jpellet [ad6583] Corrected the ending line being doubled
 macros.c 2026-03-01 jpellet jpellet [ad6583] Corrected the ending line being doubled
 macros.h 2026-02-04 jpellet jpellet [28d16d] Initial commit
 procline.c 2026-03-01 jpellet jpellet [ad6583] Corrected the ending line being doubled
 procmac.c 2026-02-15 jpellet jpellet [49ee65] added a missing case for opening ( after comma
 procmac2.c 2026-02-04 jpellet jpellet [28d16d] Initial commit
 readme.txt 2026-02-04 jpellet jpellet [28d16d] Initial commit
 str_z80.c 2026-03-01 jpellet jpellet [ad6583] Corrected the ending line being doubled
 strsubs.c 2026-03-01 jpellet jpellet [ad6583] Corrected the ending line being doubled
 strsubs.h 2026-02-04 jpellet jpellet [28d16d] Initial commit
 test.z80 2026-03-01 jpellet jpellet [ad6583] Corrected the ending line being doubled
 test2.z80 2026-02-04 jpellet jpellet [28d16d] Initial commit
 test3.z80 2026-02-04 jpellet jpellet [28d16d] Initial commit
 test4.z80 2026-03-01 jpellet jpellet [ad6583] Corrected the ending line being doubled
 tests.c 2026-03-01 jpellet jpellet [ad6583] Corrected the ending line being doubled
 tests.h 2026-02-04 jpellet jpellet [28d16d] Initial commit

Read Me

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.
MongoDB Logo MongoDB