I apologize in advance if my question is inappropriate here.
I'm trying to write code in xc16 assembler. I don't understand how to place constants in program memory. In theory, you just need to place data in the program area (after the .text directive). But if I do this:
.text
...
COEFF_A: .hword 0x4000,0x8F5B,0x4BB5,0xEE34
COEFF_B: .hword 0x2511,0x6F33,0x6F33,0x2511
.end
Then the compiler perceives the labels COEFF_A and COEFF_B as invalid assembler instructions.
If I do this:
.text
...
.data
COEFF_A: .hword 0x4000,0x8F5B,0x4BB5,0xEE34
COEFF_B: .hword 0x2511,0x6F33,0x6F33,0x2511
.end
The compiler places constants in the data area.

Tell me what I'm doing wrong?
Posted on: May 07, 2025, 09:59:15 09:59 - Automerged
If I do this:
.text
...
.section .const
COEFF_A: .hword 0x4000,0x8F5B,0x4BB5,0xEE34
COEFF_B: .hword 0x2511,0x6F33,0x6F33,0x2511
.end
The data seems to appear in the program memory area. But in my opinion, this is not quite the correct syntax.