### DATA Module Definition Statement (OS/2)

Syntax: | Parameters:
CODE attributes | IOPL|NOIOPL NONE|SINGLE|MULTIPLE READONLY|READWRITE SHARED|NONSHARED

Use the DATA statement to define default attributes for data segments within the executable you are creating. You can override the default attributes with the SEGMENTS statement, or the /SECTION option, which define attributes for specific segments.

Attribute Rules

- You can only specify one attribute from each group.
- If you specify none of the attributes in a group, the linker uses the default.
- Attributes can appear in any order.

Parameters

IOPL|NOIOPL

  The default is NOIOPL.

  Use these attributes to determine whether a segment has I/O privilege , that is, whether it can access the hardware directly.
  IOPL specifies that the segment has I/O privilege.
  NOIOPL specifies that the segment does not have I/O privilege.
  Note: 32-bit segments must be NOIOPL. You cannot specify a 32-bit segment as IOPL.

NONE|SINGLE|MULTIPLE
  Use these attributes to specify how the automatic data segment can be shared. The automatic data segment is the physical segment represented by the group name DGROUP. This segment group makes up the physical segment that contains the local stack and heap of the application.
  NONE specifies that no automatic data segment is created.
  SINGLE specifies that a single automatic data segment is shared by all instances of the module. In this case, the module is said to have solo data. SINGLE is the default for .DLL files.
  MULTIPLE specifies that the automatic data segment is copied for each instance of the module. In this case, the module is said to have instance data. MULTIPLE is the default for .EXE files.

READONLY|READWRITE

  The default is READWRITE.
  Use these attributes to set the access rights to a data segment. These attributes apply to data segments only.
  READONLY specifies that the segment can only be read.
  READWRITE specifies that the segment can be both read and written to.
SHARED|NONSHARED
  Use these attributes to specify whether the segment can be shared by other processes. These attributes apply to data segments only.
  SHARED specifies that one copy of the segment is loaded and shared among all processes accessing the module. SHARED is the default for dynamic link library (.DLL) files.
  NONSHARED specifies that the segment cannot be shared, and must be loaded separately for each process. NONSHARED is the default for executable program (.EXE) files.

Summary of Module Definition Statements