[COFF] [TUHS] Maximum Array Sizes in 16 bit C

Douglas McIlroy douglas.mcilroy at dartmouth.edu
Tue Sep 24 06:59:14 AEST 2024


A summary of a couple of longer posts.

Ralph Corderoy and I used different C syntax than to access an MxN array A,
whose subscripts begin at M0 and N0 in the respective dimensions. Here's a
somewhat simplified version of both. In our examples, M0 and M0 were
negative.

Mine:
int base[M][N];
#define A(i,j) base[i-M0][j-N0]

Ralph's
int base[M][N];
int (*A)[N] = (int(*)[N])&base[-M0][-N0];

In my scheme element references must be written A(i,j). Ralph retains C
array syntax, A[i][j].

Doug
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.tuhs.org/pipermail/coff/attachments/20240923/bd5e16cb/attachment.htm>


More information about the COFF mailing list