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

Debug problem in ver. 7.04

I try to debug simple code

static void com_isr (void) interrupt 4 using 1 {
unsigned char data c;
/*- Received data interrupt. -*/
  if (RI) {
    c = SBUF;
    RI = 0;
    ...
    ...
  }
}
and local variable c do not have a value of SBUF and I don't see any local variables in the "Locals" page of "Watch" window.
Can anybody help?

Parents
  • The carry flag is normally CY and I know that I have used a variable name of c without any problems.

    I suspect the optimiser. Look at the assembly code (in the xxx.cod listing), I expect that you will find that c is assigned to a register. This seems to give the debugger some problems when it tries to find a value.

    A couple of ideas: Try defining c as a static or volatile or try turning the level of optimisation right down.

Reply
  • The carry flag is normally CY and I know that I have used a variable name of c without any problems.

    I suspect the optimiser. Look at the assembly code (in the xxx.cod listing), I expect that you will find that c is assigned to a register. This seems to give the debugger some problems when it tries to find a value.

    A couple of ideas: Try defining c as a static or volatile or try turning the level of optimisation right down.

Children