I am programming 16F886 and here is a sample of inline asm:
#asm
psect TxtData,class=CODE,delta=2
global _text1,_text2
_text1: dw 'T','E','X','T','1',0
_text2: dw 'T','E','X','T','2',0
#endasm
I need to point EEADR and EEADRH to each of the labels to read the flash memory.
In pure asm, I would just use the Low/High operands to get the address of each label e.g. movlw low Text1
.
In C, I need something like a "const pointer" for each of the labels but I can't make it to work.
I am using the Hitech C compiler for PIC 10/12/16.
extern const char *text1;
. What have you tried? And what error messages are you getting? – user3386109db
directive, not thedw
directive. The former will treat each character as a byte (as you want), the latter will treat them as 16-bit words, which is incorrect for C. You can also use plain strings in single quotes after adb
directive, e.g._text1: db 'TEXT1'
– slugonamissionEEADR=&text1
i get "67.14 illegal conversion of pointer to integer". The code produced seems to pass the low byte correct though. – tcopEEADR= Text1
? – Weather Vane