On 4 feb 2004, at 22:02, Brad Post (MACBU) wrote: Sorry, let me clarify, I am writing assembly code, using a .s file with GCC, I don't need to know how to do macros with c or cpp files, but with assembly files. Ok. This comes from a 80x86 gnu assembler file, but I guess the syntax is the same under Mac OS X: .macro diota_trace_struct_stack_ NAME TYPE OFFSET ADJUST .globl \NAME .type \NAME,@function \NAME: push %ebp mov %esp,%ebp // Guard against C calling convention pushf push %eax push %ecx push %edx // create struct t_mem_access on the stack // ADDRESS leal \OFFSET(%ebp),%eax // if it is a push, adjust by subtracting LENGTH from ADDRESS \ADJUST push %eax [snip] .size \NAME,.-\NAME .endm .macro adjust sub 12(%ebp),%eax .endm diota_trace_struct_stack_ diota_trace_struct_push_ STORE 16 adjust diota_trace_struct_stack_ diota_trace_struct_pop_ LOAD 16 Jonas _______________________________________________ darwin-kernel mailing list | darwin-kernel@lists.apple.com Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-kernel Do not post admin requests to the list. They will be ignored.