Jump to content



0

Moving around code causes bugs?


3 replies to this topic

#1 Andrew Re OFFLINE  

Andrew Re

    Combat Commando

  • 2 posts

Posted Sun Dec 25, 2011 3:43 AM

If previously working code starts behaving funny because it's moved to a different ROM location, could that have something to do with the 1 cycle penalty for crossing a page? It's hard to tell exactly what's happening but at a glance the wrong byte is written to GRP0 when it should be erased with a zero. Moving the data used by the kernel to after the kernel solves the bug. I just want to ask if anyone has seen a problem like this before getting down to the nitty-gritty of following the debugger.

#2 Rybags OFFLINE  

Rybags

    Quadrunner

  • 10,314 posts
  • Location:Australia

Posted Sun Dec 25, 2011 5:07 AM

That could do it.

Inadvertantly coding direct addresses instead of using labels or setting up z-page pointers using part of the address rather than high/low byte of a label can break stuff too.

Moving the code but keeping the low byte of the address the same should keep the cycle count the same though.

#3 GroovyBee OFFLINE  

GroovyBee

    7800 Developer

  • 5,782 posts
  • Busy bee!
  • Location:North, England

Posted Sun Dec 25, 2011 6:17 AM

How about posting the snippets of code that have the problem and a map file (symbol table) so that we don't have to guess ;).

#4 Andrew Re OFFLINE  

Andrew Re

    Combat Commando

  • 2 posts

Posted Tue Dec 27, 2011 2:27 AM

Thanks for the responses. I'm gonna hold off on looking into this further since my kernel logic is now causing a few problems...




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users