Hi guys ,

this bit of code is giving some strange results when i look at the values loaded into the test Variable STDByteTmp which i cant explain and solve

the code is to read the values stored on the eeprom into a varable pointed to by V


what is happening is that V is counting ok and reading the values of location 1 and 2 correctly into STDbyteTmp , but as V counts to 3, it appears to load the value stored at location 3 ( $7 ) into V and then V goes to value of 8 and i cant see why this the case.

all the variables are defined as byte and i can see the data in the eeprom is correct

can someone tell me why this is the case

Cheers

Sheldon




Code:
DATA @1,$9,$8,$7,$6                                ' stores these values from location 1  to the eeprom at programming time



 For V = 1 to 4
         read V,STDByte(V)                           ' read from location 1 - 4  data byte
         STDByteTmp = STDByte(V)                ' get into temp var   for testing
 next V