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

local variables lose values ?

Hello,

I have a project (C166/HUGE memory model), where some local variables seems to lose their values. Everything worked fine, until I added some more code to a specific function (and one more local variable):

unsigned char Ptmp=0,FSzu=0,IsCancelled=1,errors=0,
FSDin,f3=0,f4=0,Abort=0,ii,done=0;

"done=0" was added to the list. Now, the compiled program seems to have a problem with the variable IsCancelled (set to 1 initially, but whenever referred to it in the function, it returns 0).

The .LST file shows this now (IsCancelled is not "working" anymore):

NAME            CLASS    SPACE  TYPE   OFFSET   SIZE
----------------------------------------------------
  Ptmp . . . .  --reg--         uchar  -----    1
  FSzu . . . .  auto            uchar     2H    1
  IsCancelled.  auto            uchar     0H    1
  errors . . .  auto            uchar     6H    1
  FSDin. . . .  auto            uchar     8H    1
  f3 . . . . .  auto            uchar     AH    1
  f4 . . . . .  auto            uchar     CH    1
  Abort. . . .  auto            uchar     EH    1
  ii . . . . .  --reg--         uchar  -----    1
  done . . . .  auto            uchar     2H    1

The old .LST file, when everything was still working, showed this:

NAME            CLASS    SPACE  TYPE   OFFSET   SIZE
----------------------------------------------------
  Ptmp . . . .  auto            uchar     0H    1
  FSzu . . . .  auto            uchar     2H    1
  IsCancelled.  --reg--         uchar  -----    1
  errors . . .  auto            uchar     6H    1
  FSDin. . . .  auto            uchar     8H    1
  f3 . . . . .  auto            uchar     AH    1
  f4 . . . . .  auto            uchar     CH    1
  Abort. . . .  auto            uchar     EH    1
  ii . . . . .  --reg--         uchar  -----    1

Ok, the class of the variable in question has changed, but it should still work, shouldn't it?
What could cause the problem, and how would one prevent this from happening?

Any help would be great!

Thank you in advance.
Holger

0