Clear the 68040 processor cache
The 68040 processor has a data cache that is unique in causing unexplainable crashes, especially if you are writing self-modifying code. The solution is to clear the cache before the offending line of code.
The easy part is clearing the cache; the hard part is finding the spot to do it. Here is the code to clear the cache:
You would get the CPU type earlier in the program with these routines:
As for the part of the code that's causing the crash, it usually happens when you're using inline assembler and jumping to certain lines of code (in FB it may even be at a GOTO statement). You'll probably want to use MacsBug to narrow your search.