I am just looking at the c-code for the ain64-din128-dout128 example to work out how the MIOS_MPROC_EVENT_TABLE works. I am stumbling across the following:
In mios.tables.inc MIOS_MPROC_EVENT_TABLE is defined to be 256 entries of size 2Bytes (dw), so it is 512 Bytes. (Makes sense to me, for 128 buttons I need to store 2 messages per button (on and off), and I need two bytes to define each).
In cmios.h, however, MIOS_MPROC_EVENT_TABLE is declared as unsigned char [2*128], so it is only 256 Bytes long, only half the size!
Do I only have access to half of the table in C-programs?
I would like to come back to my original question of this thread:
The table MIOS_MPROC_EVENT_TABLE has 512 bytes (256 dw entries) on the assembler side, defined in mios_tables.inc. On the C-cide it is defined as an
extern const unsigned char [2*128]
, so 256 bytes.
Does this mean that I can only acces the first 128 entries of the table? Or can I safely ignore the size of the array in the cmios.h file and access the data beyond the first 128 entries? (I assume the latter, I would actually be surprised if the SDCC supports runtime array bounds checking).