Jump to content
IGNORED

stella sometimes generates "invalid instruction" error, other times runs fine


tinco

Recommended Posts

I just recently got the bug to do some 2600 programming for fun. I'm seeing some odd and inconsistently occurring behavior launching builds in stella, and wonder if anyone else has seen anything similar. Sometimes, the binary loads and runs fine, sometimes it'll cause an "invalid instruction" error to pop up in the debugger during execution. When this happens, the debugger doesn't seem to understand the list file even though the console output says the lst file was loaded and can't display symbols correctly, even though I can set the program counter field in the editor to the start of cartridge memory and see that the instructions look correct in rom. If I build and debug stella from code in visual studio, when things go sideways it looks like subroutine return instructions aren't being handled correctly, with a corrupted or incorrect return address stored on the stack. This isn't all the time, but it happens some times when loading the binary. When it DOES work, everything is fine, code runs as expected, symbols look correct in debugger view in stella. Running the same binary in z64k seems to always work just fine. I'm building and running on a windows machine, latest stella code (7.0). I haven't spent a ton of time on this yet, and not a ton of time stepping through what stella is doing, but I can see that sometimes PC.

 

Code is minimal, and attached here for reference. I've cut this back to a small piece of code in the attached file; probably could reduce more, but this is a pretty small file and doesn't do much other than draw some playfield colors.

 

I'll poke around some more at some point, but in case anyone has any thoughts on this, I thought I'd post here.

minimaltest.asm

Edited by tinco
editing for clarity
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...