Jump to content
IGNORED

Wrong address loaded into accumulator


Karl G

Recommended Posts

I'm stumped on a bankswitching problem which amounts to be pushing the wrong address onto the stack, but I don't follow why the wrong address is being loaded.

 

As shown in the Stella debugger screenshot here, the address for the label "posttextkernel" here is $1F98 , and I'm trying to push (posttextkernel-1) onto the stack. Here is the snippet of source that does that:

        lda #>(posttextkernel-1)
        pha
        lda #<(posttextkernel-1)
        pha

As seen in the debugger screenshot, the first lda shows as "lda #$1F" as you would expect, but when I execute that line, I have $E0 in the accumulator instead of $1F.

 

Any ideas as to why/how this is happening?

 

post-48311-0-35467900-1550172886_thumb.png

Link to comment
Share on other sites

You can confirm that in the debugger on the CartridgeDPC+ tab:

post-3056-0-73902000-1550187058_thumb.png

 

 

You might need to adjust the debugger window and/or font size to see it - I had to in order to take the above screenshot. Click on the Options... button at the top right to bring up the options menu:

post-3056-0-43661400-1550187119.png

 

Then click on Developer... and go to the Debugger Tab:

post-3056-0-72219000-1550187144_thumb.png

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...