The size of such a variable the the maximum size defined in any module naming the variable as communal or public. The placement of communal variables is determined by the data type using established conventions (see data type and communal length below).
1 byte 2 bytes ÚÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂ--- ³ B0 ³ Record ³ ³ ³ Length ³ ÀÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁ--- 1 byte <string> 1 or 2 1 byte <- from data type -> 1 byte --ÂÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄ¿ ³Str. ³Communal ³Type ³Date ³ Communal ³Chk sum³ ³ Len ³ Name ³ Index ³ Type ³ Length ³ or 0 ³ --ÁÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÙ <-------------------- repeated --------------------->
The name is in <count, char> string format (and name may be null).
Near and Far communals from different object files are matched at bind
or link time if their names agree; the variable's size is the maximum of
the sizes specified (subject to some constraints, as documented below).
Type Index
Encodes symbol information; it is parsed as an index field (one or 2 bytes),
and not inspected by the linker.
Data Type and Communal Length
The data type field indicates the contents of the Communal Length field. All Data type values for Near data indicate that the Communal Length field has only one numeric value: the amount of memory to be allocated for the communal variable. All Data Type values for Far data indicate that the Communal Length field has two numeric values: the first is the number of elements and the second is the element size.
The DataType is one of the following hex values:
61H
The communal length is a single numeric or a pair of numeric fields (as specified by the Data Type), encoded as follows:
Groups of name, type index, segment type and communal length fields can be repeated so that more than one communal variable can be declared in the same COMDEF record. Notes:
If a public or exported symbol with the same name is found in another module with which this is bound or linked, the linker gives a multiple defined symbol error message,
Communal variables cannot be resolved to dynamic links (ie, imported symbols).
The records are ordered by occurrence, together with the items named in EXTDEF records (for reference in FIXUPS).
The IBM C Compiler generates COMDEF's for all uninitialized global data and for global scalars initialized to zero.