# 10.3.2 Labels in macros

Here there are two macro implementations for a user-defined disassembler:

    (disasm-recursive times
     ? $0 == 0               ; check if arg0 == 0
     ?? ()                   ; if matches break
     pd 1                    ; disassemble 1 opcode
     s +$$$                  ; seek curseek+opcodesize
     .(disasm-recursive $0-1))           ; recursive call to me

The problem with the recursive implementation is that will easily eat the stack if you plan to feed the macro with a large number as argument.

It is also possible to write the same loop in an iterative format:

    (disasm-iterative x
     f foo @ $0          ; foo = arg0
     label:              ; define label
     pd 1                ; disasm 1 opcode
     s +$$$              ; seek to next opcode
     f foo @ foo-1       ; foo--
     ? foo != 0          ; if (foo != 0)
     ??.label:           ;   goto label
    )

I know that this syntax looks like a mix of lisp, perl and brainfuck :) cool huh? ;)