| |||||
Technical Support Support Resources
Product Information | C251: ACCESSING ASSEMBLY ECODE VARIABLES FROM CInformation in this article applies to:
QUESTIONHow do I create ECODE tables in assembly and access them from C? ANSWERThe following assembly code defines a table named tab in ECODE (or far const) memory:
?HC?T_ASM SEGMENT HCONST
RSEG ?HC?T_ASM
tab:
DB 001H
DB 002H
DB 003H
DB 004H
DB 005H
PUBLIC tab
The following C code will read the contents of this table:
extern unsigned char const far tab [];
void main (void)
{
unsigned char tab_copy [5];
unsigned char i;
for (i = 0; i < 5; i++)
tab_copy [i] = tab [i];
while (1);
}
Last Reviewed: Thursday, January 11, 2001 | ||||
| |||||