Jump to content

Inconsistent size of MIOS_MPROC_EVENT_TABLE?


ReinerS
 Share

Recommended Posts

Hello all,

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?

??? ???

many thanks

Reiner

Link to comment
Share on other sites

Hello,

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).

Does anybody know the answer?

Thanks

Reiner

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...