Macro parameters can not be referenced inside IF blocks

Create issue
Issue #4 new
Laurens Holst repo owner created an issue

The following will produce a “Symbol not found: ?color” error:

BorderColor: MACRO ?color
    IF DEBUG
    ld a,?color
    out (#99),a
    ld a,#87
    out (#99),a
    ENDIF
    ENDM

Comments (1)

  1. Laurens Holst reporter

    As a workaround, the macro parameter can be referenced indirectly:

    BorderColor: MACRO ?color
        color: equ ?color
        IF DEBUG
        ld a,color
        out (#99),a
        ld a,#87
        out (#99),a
        ENDIF
        ENDM
    
  2. Log in to comment