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

Assembler fails to interpret RTS mnemonics #46

Closed
craigthomas opened this issue Oct 8, 2021 · 0 comments · Fixed by #47
Closed

Assembler fails to interpret RTS mnemonics #46

craigthomas opened this issue Oct 8, 2021 · 0 comments · Fixed by #47

Comments

@craigthomas
Copy link
Owner

Describe the bug
Assembling RTS statements are skipped in some instances.

To Reproduce
Steps to reproduce the behavior:

  1. Create the following file called rtsbug.asm:
                NAM     RTSBUG
                ORG     $0E00
START           LDA     #$01            ;
                RTS                     ;
                END     START
  1. Assemble the listing with the following command:
python3 assembler.py --print rtsbug.asm
  1. The RTS statement will not be compiled:
-- Assembled Statements --
$0000                         NAM RTSBUG                         ;                                         
$0E00                         ORG $0E00                          ;                                         
$0E00 8601            START   LDA #$01                           ;                                         
$0E02                         RTS ;                              ;                                         
$0E02                         END START                          ;  

Expected behavior
Expected behavior results in the following output:

-- Assembled Statements --
$0000                         NAM RTSBUG                         ;                                         
$0E00                         ORG $0E00                          ;                                         
$0E00 8601            START   LDA #$01                           ;                                         
$0E02 39                      RTS ;                              ;                                         
$0E03                         END START                          ;  

Desktop (please complete the following information):

  • OS: Ubuntu 20.04
  • Python Version: 3.8.10
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.

1 participant