Hi all.
I have working C code that I am trying to make more efficient for maximum speed.
I want to translate to asm code and then go through each command to optimize where I can. I have done this before successfully for other code snippets.
This time, however, I am running into an issue where the asm code that I have copied from the disassembly is not functioning in the same manner as the C code. Even though I copied the disassembly line from line. I've done it twice now to ensure there aren't any copy and paste errors.
The error is occurring at the end of a for loop. Here is the disassembly of that section:
109 for (i; i <= 23; i++)
C$L17:
3f61c7: 0A41 INC *-SP[1]
3f61c8: 9241 MOV AL, *-SP[1]
3f61c9: 5217 CMPB AL, #0x17
3f61ca: 56C5FE94 BF -364, LEQ
This occurs at the end of the code of the for loop, just after i is incremented, and compared to repeat the loop or not. The highlighted line is what is causing me grief. In C this line will execute without error. copying this from disassembly to asm code and executing the line drops me out of the function and I get:
"No source available for "0x3f5fff" and dropped into interrupt void ILLEGAL_ISR(void) with an ESTOP0 and infinite for loop.
So my question is what could cause this difference? Is there something else happening in the disassembly behind the scenes that I'm not seeing?
As I said earlier, I have used this method of copying disassembly into an asm source file several times now and Ive never come across one line that is executing differently.
The whole code chunk is quite long. I will post it later if needed.
Thanks in advance.