
PROGRAMMING NUMERIC APPLICATIONS
The assembler does not, however, check the types of operands used in processor control instructions. Coding FRSTOR [BP] implies that the programmer has set up register BP to point to the stack location where the processor's
The initial values for 80287 constants may be coded in several different ways. Binary integer constants may be specified as bit strings, decimal integers, octal integers, or hexadecimal strings. Packed decimal values are normally written as decimal integers, although the assembler will accept and convert other representations of integers. Real values may be written as ordinary decimal real numbers (decimal point required), as decimal numbers in scientific notation, or as hexadecimal strings. Using hexadeci- mal strings is primarily intended for defining special values such as infinities, NaNs, and nonnormal- ized numbers. Most programmers will find that ordinary decimal and scientific decimal provide the simplest way to initialize 80287 constants. Figure
Note that preceding 80287 variables and constants with the ASM286 EVEN directive ensures that the operands will be
RECORDS AND STRUCTURES
The ASM286 RECORD and STRUC (structure) declaratives can be very useful in NPX program- ming. The record facility can be used to define the bit fields of the control, status, and tag words. Figure
Because STRUCtures allow different but related data types to be grouped together, they often provide a natural way to represent "real world" data organizations. The fact that the structure template may be "moved" about in memory adds to its flexibility. Figure
THE FOLLOWING ALL ALLOCATE THI CONSTANT:
NOTE TWO'S COMPLETE STORAGE OF NEGATIVE BINARY INTEGERS,
EVEN |
|
| FORCE WORD | ALIGNMENT | ||
WORD_I NTEGER | DW | 111111111000010B | BIT | STRING |
|
|
SHORT_I NTEGER | DD | OFFFFFF82H | HEX | STRING | MUST | START |
|
|
| WITH | DIGIT |
|
|
LONG_INTEGER | DQ | ORDINARY DECIMAL |
| |||
SHORT_REAL | DD | NOTE PRESENCE OF ' , | ||||
LONG_REAL | DD | "SCIENTIFIC" |
| |||
PACKED_DECIMAL | DT | ORDINARY DECIMAL | INTEGER | |||
IN THE FOLLOWING, SIGN AND EXPONENT IS 'COOS' SIGNIFICAND IS '7EOO" ,00', 'R' INFORMS ASSEMBLER THAT THE STRING REPRESENTS A REAL DATA TYPE,
DT OCOOS7EOOOOOOOOOOOOOOR HEX STRING