Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax error not thrown when using improper addressing mode #40

Open
microaeris opened this issue Mar 19, 2019 · 1 comment
Open

Syntax error not thrown when using improper addressing mode #40

microaeris opened this issue Mar 19, 2019 · 1 comment

Comments

@microaeris
Copy link

Love your emulator; it's the perfect learning tool for 6502. On the note of learning, I managed to write some impossible 6502 and the assembler didn't throw a syntax error. :^)

  LDA #$01
  LDX #$01
  LDY #$00
loop:
  EOR X         ; Nope
  STA $0200,Y
  INY
  CPY #$10
  BNE loop

Assembled output:

0600: a9 01 a2 01 a0 00 4d ff ff 99 00 02 c8 c0 10 d0 
0610: f5 

Expected output:
An error message calling me silly names for writing that.

@BigEd
Copy link
Collaborator

BigEd commented Aug 9, 2019

I think the assembler will have taken X to be a label (or variable) - it has no defined value, but we don't detect unassigned variables, because they will always be there in the first pass. Perhaps we need to make the second pass more careful.

Thanks for the kind words... I'll keep this issue open, perhaps some day will have a proper look at the code. It's been a while.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants