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

Generating wrong code 2 - absolute variables #58

Open
Squall-FF8 opened this issue Nov 11, 2022 · 0 comments
Open

Generating wrong code 2 - absolute variables #58

Squall-FF8 opened this issue Nov 11, 2022 · 0 comments

Comments

@Squall-FF8
Copy link

The snipet is this:

var
  r0:  word absolute $02;
  r1:  word absolute $04;
  r2:  word absolute $06;
...
procedure Copy;
  var Src: word absolute $02;  // this declarations are only for convenience
      Dst: word absolute r1;
begin
    asm 
          LDA (Src), Y
          STA (Dst), Y

It generates the following code:

      $082B B1 02    LDA ($02),Y 
      $082D 91 00    STA ($00),Y   ; this is wrong should be STA ($04), Y

so when constant is used - it works fine, but if a declaration is used, it always generate $00

@Squall-FF8 Squall-FF8 changed the title Generating wrong code 2 - absolute values Generating wrong code 2 - absolute variables Nov 11, 2022
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