We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
when i debug using the simulator i get this message
undefined opcode trap detected
is it bad ?
"debug your code" is kinda general
Well, so was your description of the problem. There was basically no usable information about the actual circumstances. So if you can't figure out what went wrong, with complete access to the source and everything, how can you expect people out here, without any of that information, to pull off such a trick?
Your program ended up jumping to an address where there was no (correct) code. You'll have to figure out for yourself how that happened. The "trace" feature of the simulator (if the 166 one has that... I've never used C166 myself) should help with that. It would allow you to go back in execution time, after the crash, to find out how you got there. Failing that, you'll have to retrace your steps through the program's development history, and find out when you broke it --- that usually makes it a lot easier to find out how you broke it.