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

Expressions in left hand side of indexed program counter relative expressions not resolved #52

Closed
craigthomas opened this issue Nov 13, 2021 · 1 comment
Labels

Comments

@craigthomas
Copy link
Owner

Describe the bug
When an expression shows up in the left hand side of an indexed program counter relative expression, it is not resolved correctly.

To Reproduce

  1. Create a file called test.asm and add the following contents to it:
                ORG     $3F00
TEMP            EQU     $0001
START           STX     1+TEMP,PCR
                END     START
  1. Assemble the file with the following command:
python3 assembler.py test.asm --print
  1. The following output will appear:
-- Assembled Statements --
$3F00                         ORG $3F00                          ;       
$3F00                  TEMP   EQU $0001                          ;   
$3F00 AF8C00          START   STX 1+TEMP,PCR                     ;                     
$3F02                         END START                          ; 

Expected behavior
Correct output should be:

-- Assembled Statements --
$3F00                         ORG $3F00                          ;             
$3F00                  TEMP   EQU $0001                          ;               
$3F00 AF8D0002        START   STX 1+TEMP,PCR                     ;                      
$3F04                         END START                          ;

Desktop (please complete the following information):

  • OS: Ubuntu 20.04
  • Python Version: 3.8.10

Additional Context
Currently the output of AF8C00 is exhibiting the problem as described in issue #51 . The correct output of AF8D as the instruction and addressing mode should be fixed by that issue first. Then the issue of the expression resolution can be fixed.

@craigthomas
Copy link
Owner Author

Closed by PR #54

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

No branches or pull requests

1 participant