dasm-assembler / dasm-assembler/dasm

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

Open
#123 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
257
Forks
55
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with the supplied test.asm examples for #if/#else/#endif and IF/ELSE/ENDIF, then trace conditional handling and macro parameter validation. Done means parameters in inactive branches no longer trigger a missing-argument error, while the examples still assemble correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.