11-23-2000 11:53 PM
I found a begin of explication in m4. But i don't have example on my hp server.
I cannot use #define because i need, when the macro is expanded, to repect the asm format:
label opcode opcode_param information
and each line must on separte line (not as C).
Somebody can help me?
11-24-2000 12:03 AM
Edit with vi you main code.
At every line where you want to insert your macro code do
this inserts the contents of
Of course this is a manual procedure, hope this is what you need.
11-24-2000 12:44 AM
Instead of typing
to insert the file at cursor position from within vi
you could as well use the include statement, like in
The disadvantage of these 2 solutions is that the same file will be used.
To allow for minor changes, you should probably modify your initial asm file with some conditional steps like
11-24-2000 02:52 AM
12-05-2000 01:22 AM
-put a "!" between each instructions
-put a "\" to change line in the declaration like for C
-Use .LABEL directive to make a LABEL inside the macro and don't add any instruction after: use ! between the label and the instruction.
-To create local label use macro's arguments like the exemple at the end; the #arg will keep the "#" inside the label name!!!!
-Don't forget the "; macro" at the end of the description.
#define Toto(var1,var2) .EXPORT label#var1#var2,CODE ! .LABEL label#var1#var2 ! ldi var1,r1 ! ldi var2,r2 ; macro
In source write this:
will create this:
in c code, add this to know address (and jum perhaps...): extern "C" void label#13#14();
12-05-2000 02:10 AM
it's impossible, i think, to export in a C source the label, because the "#" cause an error in compilation. But inside assembly code it's work.
But the declaration work fine if you use good declaration like: extern "C" void label_13_14();