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

Incorrect documentation for DEFLABEL #17

Open
phillipeaton opened this issue Nov 18, 2022 · 0 comments
Open

Incorrect documentation for DEFLABEL #17

phillipeaton opened this issue Nov 18, 2022 · 0 comments

Comments

@phillipeaton
Copy link

Documentation says:

deflabel addr [name]
...
A little bit of caution is necessary here; if the same deflabel is used for different values, the last one wins and is used for the EQU statement.

What I'm seeing is that the last one is not winning, it's getting ignored, as evidenced below. I think it works fine, it's just the documentation that is wrong.

Using

deflabel 37A3 SCREEN_WIDTH_PIXELS
deflabel 37A8 SCREEN_WIDTH_PIXELS

results in

SCREEN_WIDTH_PIXELS     equ     $B8

         cmp     #SCREEN_WIDTH_PIXELS    ; 37A2: C9 B8    
         bcc     No_X_Wrap               ; 37A4: 90 03    
         sec                             ; 37A6: 38       
         sbc     #SCREEN_WIDTH_PIXELS    ; 37A7: E9 B8    

Using the address wrong for the second instance

deflabel 37A3 SCREEN_WIDTH_PIXELS
deflabel 37A7 SCREEN_WIDTH_PIXELS

results in

SCREEN_WIDTH_PIXELS     equ     $B8

         cmp     #SCREEN_WIDTH_PIXELS    ; 37A2: C9 B8    
         bcc     No_X_Wrap               ; 37A4: 90 03    
         sec                             ; 37A6: 38       
         sbc     #$B8                    ; 37A7: E9 B8    
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

1 participant