writing word data to eeprom

afb

Member
I have a word variable stored in eeprom 6 & 7 which in certain circumstances I need to reset with a fixed value, in my case 90. The statement "write 6, word 90" fails syntax check. Assigning 90 to a word variable, eg w0, and then issuing "write 6, word w0" is a work around, as is omitting the "word" qualifier and just altering the LSB and MSB in turn "write 6, 90: write 7, 0".

So I'm not stuck, but curious as to the correct syntax to perform this operation. This is for the 08M2 and I'm still using PE5 if that is relevant.

Alan

EDIT 1 hr later - ARRRGH ! ! ! - just having re-read the manual for the 20th time, this time I saw that the write syntax only accepts word variables as an argument when the qualifier "word" is used and equally I realise I could have said "write 6,90,0" as well - this is what comes of coding early in the morning before sufficient coffee has been consumed!
 
Last edited:

oracacle

Senior Member
I'm sure we can let you off, the manual is the better part of 300 pages long and we all miss something from time to time.
 

afb

Member
<red faced> Thank you Oracle - I've been assigning word *variables* to eeprom for years but this was the first time I tried with a *constant* - so, being cock-sure, I coded what I *expected* to be the case - thereafter in repeatedly reading the documentation I kept seeing the correct syntax but not actually READING it!
 
Top