dasm-assembler / dasm-assembler/dasm

Parser error

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

Nobody has claimed this yet.

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

Description

If you miss a trailing bracket on indirect,y addressing, the assembler does not flag an error, and instead assembles as absolute,y.

    251  00d8		       a0 47		      ldy	#PIECE_SHAPE_SIZE-1
    252  00da		       b9 a4 00    .copy      lda	(__psb,y
    253  00dd		       99 a6 00 	      sta	__pieceShapeBuffer,y
    254  00e0		       88		      dey
    255  00e1		       10 f7		      bpl	.copy

On the line with .copy label -- missing close bracket, yet no warning/error generated.
Also, incorrect code generated :).

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

Reproduce the issue with the shown source and trace the assembler's parser for indirect,y operands. Confirm that the missing closing bracket is rejected with an error and that valid indirect,y syntax still assembles 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
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.