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

Direct Addressing Mode does not seem to work #49

Closed
icemanind opened this issue Oct 13, 2021 · 3 comments · Fixed by #50
Closed

Direct Addressing Mode does not seem to work #49

icemanind opened this issue Oct 13, 2021 · 3 comments · Fixed by #50

Comments

@icemanind
Copy link

icemanind commented Oct 13, 2021

Describe the bug
When using direct addressing mode, no bytes seem to be created. I am using ADCA as an example, but the issue seems to affect all direct addressing mode mnemonics.

To Reproduce
Steps to reproduce the behavior:

  1. Create a file and call it test.asm:
        ORG    $1000
        ADCA    <$9F
  1. Compile using: python assembler.py --print test.asm

Expected behavior
With the print parameter in place, it should produce this output:

-- Assembled Statements --
$1000                         ORG $1000                          ;                                         
$1000      999F               ADCA <$9F     

Actual behavior
I am getting no byte codes at all:

-- Assembled Statements --
$1000                         ORG $1000                          ;                                         
$1000                         ADCA <$9F     
@craigthomas
Copy link
Owner

@icemanind looks like both explicit direct and extended addressing are not being parsed correctly. So similarly:

        ORG $1000
START   LDA >$FEEE
        END START

The problem is that extended and direct addressing are deferred until later on in the assembly process, but no check is there to see if the program listing explicitly uses < or >. I'll implement a fix for that and add some regression tests as well. Thanks for finding that and reporting it!

@icemanind
Copy link
Author

No problem! This is a fantastic project you started and it works great. Please keep up the great work! Along the same lines, looking at the code, I don't think the SETDP pseudo mnemonic is actually doing anything (other than being recognized as a pseudo-op by the parser). I haven't actually tried it though, so I could be wrong. Again, thanks for the great work on this!

@craigthomas
Copy link
Owner

@icemanind Thanks for the kind words! I really appreciate it! A new pull request should go through momentarily with a fix for the direct and extended addressing modes. You are indeed correct about the SETDP pseudo op. It's a recognized mnemonic, but it still needs to be implemented in the assembler. Thanks again!

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

Successfully merging a pull request may close this issue.

2 participants