WORD
SUNDB86x Only
The WORD compiler directive allows the insertion of 16-bit values that represent machine code instructions within PL/B source code. These values perform instructions normally unavailable in PL/B. The instruction uses one of the following formats:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Where:
label
Optional. A Program Execution Label.
code
Required. One or more control literals (binary, decimal, hex or octal), Data Definition Labels, or a VARLIST of valid data definition labels containing 16 bit absolute machine code inserted into the PL/B program.
Flags Affected: NONE
Note the following:
The value of each item in {code} is not translated but written into the output code exactly as given, in correct byte order (i.e., the least significant 8-bits followed by the most significant 8-bits). This instruction should only be used by programmers knowledgeable in machine language. This is an area where Sunbelt may offer examples but will not provide support, except at prevailing time and material consulting rates.
Multiple {code} items may be placed on a single line and may be continued onto other lines using the colon (:) line continuation technique.
A Data Definition Label may be a {list} item to reference a variable. The compiler automatically inserts the address of the variable, in correct byte order, in place of the referenced variable.
Multiple +/- operations may be performed on an address by placing a plus (+) or minus (-) sign and a valid Ctrl literal designating the number of offset bytes immediately following the Data Definition Label.
When referencing variables within {code}, care should be taken not to overwrite the variable designator or FP/LP (as appropriate). When a Data Definition Label is used, the memory location referenced is not the first byte of the data for the variable. Therefore, it is necessary to increment this address by one (1) for FORMs or INTEGERs and by two (2) for DIMs or INITs to access the data therein.
Moving data into a DIM/INIT does not automatically adjust the FP or LP as if performed through other PL/B instructions. Any data transferred may not be accessible until the FP and LP have been adjusted appropriately.
If the DS, ES, SS, or SP registers are modified, they must be saved prior to such modification and restored before executing a PL/B instruction other than BYTE or WORD. The saving and restoration may be accomplished using BYTE/WORD instructions.
To write out multiple 8-bit values, BYTE should be used instead of WORD.
See Also: Example Code, BYTE, BYTEX, ENTERZ/EXITZ, WORDX, Compiler Directives
![]() |