Steve, I would appreciate an explanation of how this works...does @_idlocs XXXXXX automatically read the TBLPTRx addresses from addresses 200000-20000h in an 18F MCU and put it into EEPROM or what? I have been doing this by the use of below code. If they are equivalent, your ASM single line of code is definitely preferable!
Regards and extremely glad to see you back in the forum and contributing, John Ellis
'Read MCU Serial Number from device ID Locations
TBLPTRU=$20 ' Address $200000
TBLPTRH=$00
TBLPTRL=$00
For i = 0 To 7
@ TBLRD*+ ; Get value and increment the address
ID(i) = TABLAT ; Store the byte as ID(i)
Next
deviceID1 = ID(0) ' MSB of MCU Device Serial Number
deviceID2 = ID(1) ' LSB of MCU Device Serial Number
WRITE 240, ID(0) ' Write serial number to EEPROM
WRITE 241, ID(1)
Bookmarks