Referring to instruction:
mov DPTR, #data16
I have 2 programs: test.c and test2.asm. In test.c I have:
------------------------------------------ const unsigned int code TEST[3] = {1,2,3}; unsigned int *index; extern void programcode(void);
void main(void) {
index = &TEST[0]; programcode();
}------------------------------------------
and in test2.asm I have:
------------------------------------------ EXTRN DATA (index)
programcode: mov A, #0 mov DPTR, #index movc A, @A+DPTR ret END
------------------------------------------
Does "mov DPTR, #index" mean "move the value stored in variable named "index" into DPTR" or does it mean "move the address of variable named "index" into DPTR"? I observe the latter, but I want to implement the former. Any help would be appreciated.