I want to define a table of constants like this:
code const unsigned char bit_count_table[16] = { 0, 1, .... 4 };
?CO?ASMSUBS SEGMENT CONST
Using A51 instead of AX51?
Yes I am using A51 and I would like to keep it that way if at all possible.
Ah. I'm afraid you might have to make a choice, then. In my manual where it talks about classes for segments (page 107 of the assembler manual) the chart shows the CONST class highlighted in green, which the footnote says means a feature only available in AX51 / A251. A51 apparently supports BIT, CODE, DATA, IDATA, and XDATA. You need AX51 for CONST, EBIT, EDATA, ECONST, ECODE, HCONST, and HDATA. If you don't want to use AX51, I'd think you would be able to declare your segment as CODE in A51. It seems the only thing CONST really buys you is semantics: letting the assembler know to reject any instructions that might appear in the segment, hopefully not to jump to labels in that segment, and so on.
I tried various combinations of 'code' and 'const' to no avail. In the end I rewrote the function with the table in assembler defined using 'DB' values and that solved my immediate problem. Thanks to all.