str_z80 str_z80
A structured macro preprocessor written in C for SDCC Z80 assembler
Brought to you by:
jpelletier
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.