CODE Module Definition Statement (OS/2)
| Syntax: |
Parameters: |
| CODEattributes |
CONFORMING|NONCONFORMING
EXECUTEONLY|EXECUTEREAD
IOPL|NOIOPL
|
Use the CODE statement to define default attributes for code
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 pair.
- If you specify neither attribute, ILINK uses the default.
- Attributes can appear in any order.
Parameters
- CONFORMING|NONCONFORMING
- The default is NONCONFORMING.
- Specify whether a code segment is a 286- conforming
segment. These attributes are relevant for device
drivers, or system-level code, and apply to code segments
only.
CONFORMING uses a range of instructions that can be
executed by a 286 (16-bit) processor. A CONFORMING
segment can be called from either Ring 2 or Ring 3, and
executes at the privilege level of the caller.
NONCONFORMING uses instructions that require a 386
processor or higher. The segment is not guaranteed to be
executable by a 286 processor.
- EXECUTEONLY|EXECUTEREAD
- The default is EXECUTEREAD.
-
- Specify whether a code segment can be read as well as
executed. These attributes apply to code segments only.
EXECUTEONLY specifies that the segment can only be
executed.
EXECUTEREAD specifies that the segment can be both
executed and read.
- 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.

Summary of Module Definition Statements