This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

error 65 with 89C51ED2

Hello,

I wrote a program for a 89C51ED2 (using C instructions, not assembler, it's easier for me...); the compilator is OK, but when I use the simulator, I get the error 65 with the return of a sub program to the main one; in the disassembly window, I can see that there is no instruction (just "NOP") at the adress after the RET instruction. I tried to modify some instructions, I get some results, but still the error 65 appears, at different locations of the program.

Some other times, the simulator goes to some used part of the program, but jumping instructions that should precede.

As I do not control the compliling process, I just don't know what to do, and what is hapening.

Does someone understand what is happening, and where I am wrong??

Thanks.

Parents
  • A bit of source code is better than a thousand words...

    Anyway, are you making sure that all your accesses to BP_Octet[i][j] are valid? If i or j is out-of-bounds, you may overwrite important data.

    Are you compiling with optimization? If you have optimized code, then the order of execution may change, making it hard to debug.

    Another thing: If the switch block is last in your function, then the last case statement may have a do-nothing break - the fourth case will be the last, followied by one or more end braces before you end the function. The compiler need not perform any break then, since it will notice that the break doesn't change the program flow: The function will end with or without any break statement.

Reply
  • A bit of source code is better than a thousand words...

    Anyway, are you making sure that all your accesses to BP_Octet[i][j] are valid? If i or j is out-of-bounds, you may overwrite important data.

    Are you compiling with optimization? If you have optimized code, then the order of execution may change, making it hard to debug.

    Another thing: If the switch block is last in your function, then the last case statement may have a do-nothing break - the fourth case will be the last, followied by one or more end braces before you end the function. The compiler need not perform any break then, since it will notice that the break doesn't change the program flow: The function will end with or without any break statement.

Children
No data