4 The purposes of the macro system are:
5 1. Provide a way to target other assemblers than asxxxx, such as the
6 GB IAR or rgbds assemblers.
7 2. Provide a way to target multiple similar processors at a relatively
8 simple level from one backend, such as the gbz80 and z80.
9 3. Provide a way to dynamically build a command line for any spawned
11 4. Provide a way for the backend to convientely access volatile global data
12 such as the source file name or current function name. This is mainly
13 to get around assembler limitations.
16 1. Different assemblers use different forms for immediate values.
21 Different assemblers use different forms for certain constructs.
27 2. Some concepts, such as prolog and epilogue can be combined.
35 3. Various paths such as include or library paths may change at run
38 4. Need to use the function name in a temporary variable name as the
39 assembler doesn't support temporary local labels
45 1. Static for a given starting set of parameters, such as target
48 {zero} -> #0, $0, 0x00
49 {sdccinclude} -> c:/sdcc/include, /usr/share/sdcc/include
51 2. Static for a given starting set of parameters, but include
54 {immeda} -> #0x%02X, $%02X
55 {areaa} -> .area %s, SECTION "%s"
57 3. Volatile throughout the run time with no parameters
61 4. Volatile with arguments
62 {templabeldef} -> {currfuncv}_%d:
65 1. Macros are surrounded by curly braces {}.
66 2. Curly braces cannot appear in any data.
67 3. Macros will be recursively expanded. The expansion cannot be
69 4. Macros used as values to arguments will be recursively expanded.
70 Any macros used as argument values cannot require arguments. If they
71 do the arguments will not be evaluated.
74 1. There is no type checking or usage checking due to things being
75 evaluated at run time. This could be verified by using a separate
76 perl script to statically evaluate the strings.