I'm using the Keil C251 Compiler Optimizing 80251 C Compiler Version 1.x (DLL 1.24) The following instruction is in a function called after an SIO Interrupt: byLength = abyRecBuf[0] And the generated code is 7E7301D0 MOV R7,ABYRECBUF 7E004D MOV R0,#4D A5A607 MOV @R0?#BOOTDOWN#Value 4D is byLength's memory address and Value is a parameter from BootDown witch has nothing to do with the SIO interrupt. Is it a compiler bug ????
I am only familiar with the C51, but I suspect that the same points apply. When looking at code, the disassembler will attempt to find labels that match a value - but it's not psychic and consequently may display an inappropriate label that just happens to have the right value. This can be very confusing. The important question is: is the code actually wrong?
Yes the code is actally wrong, seeing that after the execution of the c-line : byLength = abyRecBuf[0]; The value of byLength is wrong.