We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I created a table, where I have various data. I need to take out data from this table, alter it, then write it back to the same position, however, for some reason, data is not written to the position
Here is my code
CSEG AT 3h table: DB 100, 200, 150, 170
Lookup: MOV DPTR, #precos ; DPTR points to the start of the lookup table MOV A, #0 ; A is the offset from the start of the lookup table MOVC A, @A + DPTR ; Moves the (A+1)th item into the Accumulator ADD A, #20 MOV R1, #3 MOV @R1, A JMP Lookup
When I loop through the code, A goes from 0 to 100 to 120, then it's supposed to write it at position 3, get it back again, add 20 more, etc...
What I actually need, is a way to access a memory position, alter it, then update it.
Just remember that you need to write to RAM or some suitable EEPROM - normal flash needs to be erased before you can write to it.
Right now, I don't care which memory I write to, I first need to be able to write xD