Open
Description
.undef
doesn't seem to work when used inside .macro
-style or .define
-style macros. A few minimal examples are below. It seems like macro replacement isn't getting switched off, so it's trying to undefine the defined value rather than the macro itself. Note that .define
works as expected when used inside a macro.
; case 1: undefine macro outside a macro (works fine)
.define def1 1
.undef def1
; case 2: undefine a constant-valued macro inside a macro (fails)
.define def2 2
.mac undef2
.undef def2
.endmac
undef2
; undef.asm(11): Error: Identifier expected
; undef.asm(2): Note: Macro was defined here
; case 3: undefine a variable-valued macro inside a macro (fails differently)
.define def3 Three
.mac undef3
.undef def3
.endmac
undef3
; undef.asm(22): Error: No such macro: Three
; undef.asm(18): Note: Macro was defined here
; case 4: undefine a macro inside a C-style macro (fails)
.define def4 4
.define undef4 .undef def4
undef4
; undef.asm(31): Error: Identifier expected
; undef.asm(29): Note: Macro was defined here