dasm-assembler / dasm-assembler/dasm

Macros can't redefine instructions

Open
#110 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

I wanted to block out a particular instruction from use in my program.
I thought to define the instruction as a macro, and ERR inside the macro.
However, to my surprise, you don't appear to be able to redefine an instruction.

 MAC LDA ; redefine as an error!
  ECHO 'Don't use LDA!'
  ECHO {0}
  ERR
 ENDM

In my tests, the macro is never instantiated.
Perhaps the documentation needs updating to indicate - or is it possible to 'fix' this issue?

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

The issue provides a minimal MAC LDA example but names no source files or tests. Start by reproducing the example and tracing how macro names are checked against instruction names; determine whether redefining an instruction should work or whether the documentation should describe it as unsupported.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
compilers
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.