Menu

Tree [28d16d] master /
 History

HTTPS access


File Date Author Commit
 Makefile 5 days ago jpellet jpellet [28d16d] Initial commit
 common.h 5 days ago jpellet jpellet [28d16d] Initial commit
 cond.c 5 days ago jpellet jpellet [28d16d] Initial commit
 cond.h 5 days ago jpellet jpellet [28d16d] Initial commit
 config.h 5 days ago jpellet jpellet [28d16d] Initial commit
 macros.c 5 days ago jpellet jpellet [28d16d] Initial commit
 macros.h 5 days ago jpellet jpellet [28d16d] Initial commit
 procline.c 5 days ago jpellet jpellet [28d16d] Initial commit
 procmac.c 5 days ago jpellet jpellet [28d16d] Initial commit
 procmac2.c 5 days ago jpellet jpellet [28d16d] Initial commit
 readme.txt 5 days ago jpellet jpellet [28d16d] Initial commit
 str_z80.c 5 days ago jpellet jpellet [28d16d] Initial commit
 strsubs.c 5 days ago jpellet jpellet [28d16d] Initial commit
 strsubs.h 5 days ago jpellet jpellet [28d16d] Initial commit
 test.z80 5 days ago jpellet jpellet [28d16d] Initial commit
 test2.z80 5 days ago jpellet jpellet [28d16d] Initial commit
 test3.z80 5 days ago jpellet jpellet [28d16d] Initial commit
 tests.c 5 days ago jpellet jpellet [28d16d] Initial commit
 tests.h 5 days ago 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.