+Karl G Posted February 14, 2019 Share Posted February 14, 2019 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? Quote Link to comment Share on other sites More sharing options...
DirtyHairy Posted February 14, 2019 Share Posted February 14, 2019 I guess fast DPC+ fast fetch is active: in this mode, an immediate LDA of a value < 0x28 will not load the actual value, but the corresponding fetcher instead. 2 Quote Link to comment Share on other sites More sharing options...
+Karl G Posted February 14, 2019 Author Share Posted February 14, 2019 Oh! Indeed, I turned it on too soon. Thanks. :-) Quote Link to comment Share on other sites More sharing options...
+SpiceWare Posted February 14, 2019 Share Posted February 14, 2019 You can confirm that in the debugger on the CartridgeDPC+ tab: 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: Then click on Developer... and go to the Debugger Tab: 1 Quote Link to comment Share on other sites More sharing options...
+Karl G Posted February 14, 2019 Author Share Posted February 14, 2019 That's good to know for future reference - thanks! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.