dasm-assembler / dasm

Macro assembler with support for several 8-bit microprocessors

Home Page:https://dasm-assembler.github.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Macros detects parameters in the false portion of #if/#else/#endif and IF/ELSE/ENDIF directives

pizzatari opened this issue · comments

The assembler detects a parameter inside #if blocks when it's the false portion and issues an error if a parameter is not passed. I think it should ignore {n} parameters in the false block.

dasm test.asm -otest.bin
test.asm (12): error: Not enough args passed to Macro.

Unrecoverable error(s) in pass, aborting assembly!
Complete. (5)

Samples:

    processor 6502

    ORG $1000

    MAC MAC_TEST
#if 0
label{1}label
#endif
    ENDM

    MAC_TEST

And

    processor 6502

    ORG $1000

    MAC MAC_TEST
    IF 1
    ELSE
label{1}label
    ENDIF
    ENDM

    MAC_TEST