Updated: 11 December 1998 |
VAX MACRO and Instruction Set Reference Manual
Previous | Contents | Index |
Divide Packed
opcode divrlen.rw, divraddr.ab, divdlen.rw,
divdaddr.ab, quolen.rw, quoaddr.ab
N|| <--- {quo string} LSS 0; | |
Z|| <--- {quo string} EQL 0; | |
V|| <--- {decimal overflow}; | |
C|| <--- 0; |
27 | DIVP | Divide Packed |
The dividend string specified by the dividend length and dividend address operands is divided by the divisor string specified by the divisor length and divisor address operands. The quotient string specified by the quotient length and quotient address operands is replaced by the result.
Notes
R0 = | 0 |
R1 = | Address of the byte containing the most significant digit of the divisor string |
R2 = | 0 |
R3 = | Address of the byte containing the most significant digit of the dividend string |
R4 = | 0 |
R5 = | Address of the byte containing the most significant digit of the quotient string |
Move Packed
opcode len.rw, srcaddr.ab, dstaddr.ab
N|| <--- {dst string} LSS 0; | |
Z|| <--- {dst string} EQL 0; | |
V|| <--- 0; | |
C|| <--- C; |
34 | MOVP | Move Packed |
The destination string specified by the length and destination address operands is replaced by the source string specified by the length and source address operands.
Notes
R0 = | 0 |
R1 = | Address of the byte containing the most significant digit of the source string |
R2 = | 0 |
R3 = | Address of the byte containing the most significant digit of the destination string |
Multiply Packed
opcode mulrlen.rw, mulraddr.ab, muldlen.rw,
muldaddr.ab, prodlen.rw, prodaddr.ab
N|| <--- {prod string} LSS 0; | |
Z|| <--- {prod string} EQL 0; | |
V|| <--- {decimal overflow}; | |
C|| <--- 0; |
25 | MULP | Multiply Packed |
The multiplicand string specified by the multiplicand length and multiplicand address operands is multiplied by the multiplier string specified by the multiplier length and multiplier address operands. The product string specified by the product length and product address operands is replaced by the result.
Notes
R0 = | 0 |
R1 = | Address of the byte containing the most significant digit of the multiplier string |
R2 = | 0 |
R3 = | Address of the byte containing the most significant digit of the multiplicand string |
R4 = | 0 |
R5 = | Address of the byte containing the most significant digit of the product string |
Subtract Packed
4operand: opcode sublen.rw, subaddr.ab,
diflen.rw, difaddr.ab6operand: opcode sublen.rw, subaddr.ab,
minlen.rw, minaddr.ab,
diflen.rw, difaddr.ab
N|| <--- {dif string} LSS 0; | |
Z|| <--- {dif string} EQL 0; | |
V|| <--- {decimal overflow}; | |
C|| <--- 0; |
22 | SUBP4 | Subtract Packed 4 Operand |
23 | SUBP6 | Subtract Packed 6 Operand |
In 4 operand format, the subtrahend string specified by the subtrahend length and subtrahend address operands is subtracted from the difference string specified by the difference length and difference address operands, and the difference string is replaced by the result.In 6 operand format, the subtrahend string specified by the subtrahend length and subtrahend address operands is subtracted from the minuend string specified by the minuend length and minuend address operands. The difference string specified by the difference length and difference address operands is replaced by the result.
Notes
R0 = | 0 |
R1 = | Address of the byte containing the most significant digit of the subtrahend string |
R2 = | 0 |
R3 = | Address of the byte containing the most significant digit of the difference string |
R0 = | 0 |
R1 = | Address of the byte containing the most significant digit of the subtrahend string |
R2 = | 0 |
R3 = | Address of the byte containing the most significant digit of the minuend string |
R4 = | 0 |
R5 = | Address of the byte containing the most significant digit of the difference string |
9.2.12 The EDITPC Instruction and Its Pattern Operators
The EDITPC instruction implements the common editing functions that
occur when handling fixed-format output. The operation consists of
converting an input packed decimal number to an output character string
and generating characters for the output. When converting digits,
options include filling in leading zeros, protecting leading zeros,
insertion of floating sign, insertion of floating currency symbol,
insertion of special sign representations, and blanking an entire field
when it is zero. An example of this operation is a MOVE to a numeric
edited (PICTURE) item in COBOL or PL/I. Many other applications are
possible.
The operands to the EDITPC instruction are as follows:
The EDITPC instruction manipulates two character registers and the four condition codes:
The fill register (R2<7:0>) contains the fill character. This is normally an ASCII blank but could be changed to an asterisk (*), for instance, for check protection.
The sign register (R2<15:8>) contains the sign character. Initially this register contains either an ASCII blank or a minus sign (--), depending upon the sign of the input. You can change the contents of this register to allow other sign representations such as plus/minus or plus/blank. You can also manipulate it to output special notations such as CR or DB. To implement a floating currency sign, you can change the sign register to the currency sign.
After execution, the condition codes describe the following:
N | The sign of the input |
Z | The presence of a zero source |
V | An overflow condition |
C | The presence of significant digits |
Condition code N is determined at the start of the instruction and remains unchanged (except for correcting a --0 input). The processor computes and updates the other condition codes as the instruction proceeds.
When the EDITPC instruction completes processing, registers R0 to R5 contain the values they would normally have after a decimal instruction.
Edit Packed to Character String
opcode srclen.rw, srcaddr.ab, pattern.ab, dstaddr.ab
N|| <--- {src string} LSS 0; !N <- 0 if src is -0 | |
Z|| <--- {src string} EQL 0; | |
V|| <--- {decimal overflow}; !nonzero digits lost | |
C|| <--- {significance}; |
38 | EDITPC | Edit Packed to Character String |
The destination string specified by the pattern and destination address operands is replaced by the edited version of the source string specified by the source length and source address operands. The editing is performed according to the pattern string, starting at the address of the pattern operand and extending until a pattern end pattern operator (EO$END) is encountered.The pattern string consists of 1-byte pattern operators. Some pattern operators take no operands. Some take a repeat count that is contained in the rightmost nibble of the pattern operator itself. The rest take a 1-byte operand that immediately follows the pattern operator. This operand is either an unsigned integer length or a byte character.
Table 9-1 lists the pattern operators that can be used with the EDITPC instruction to form a pattern. Subsequent pages define each pattern operator in a format similar to that of the normal instruction descriptions. In each case, if there is an operand, it is either a repeat count (r) from 1 to 15, an unsigned byte length (len), or a character byte (ch). The encoding of the pattern operators is represented graphically in Table 9-2.
See Appendix E for information about exceptions that affect the EDITPC instruction.
Notes
R0 = | Length of source string |
R1 = | Address of the byte containing the most significant digit of the source string |
R2 = | 0 |
R3 = | Address of the byte containing the EO$END pattern operator |
R4 = | 0 |
R5 = | Address of 1 byte beyond the last byte of the destination string |
N = | { src has minus sign} |
Z = | All source digits zero so far |
V = | Nonzero digits lost |
C = | Significance |
R0<31:16> = | --(count of source zeros to supply) |
R0<15:0> = | Remaining srclen |
R1 = | Current source location |
R2<31:16> = | Implementation dependent |
R2<15:8> = | Current contents of sign register |
R2<7:0> = | Current contents of fill register |
R3 = | Location of edit pattern operator causing exception |
R4 = | Implementation dependent |
R5 = | Location of next destination byte |
Name | Operand | Summary |
---|---|---|
Insert operators | ||
EO$INSERT | ch | Insert character, fill if insignificant |
EO$STORE_SIGN | --- | Insert sign |
EO$FILL | r | Insert fill |
Move operators | ||
EO$MOVE | r | Move digits, fill if insignificant |
EO$FLOAT | r | Move digits, floating sign |
EO$END_FLOAT | --- | End floating sign |
Fixup operators | ||
EO$BLANK_ZERO | len | Fill backward when 0 |
EO$REPLACE_SIGN | len | Replace with fill if --0 |
Load operators | ||
EO$LOAD_FILL | ch | Load fill character |
EO$LOAD_SIGN | ch | Load sign character |
EO$LOAD_PLUS | ch | Load sign character if positive |
EO$LOAD_MINUS | ch | Load sign character if negative |
Control operators | ||
EO$SET_SIGNIF | --- | Set significance flag |
EO$CLEAR_SIGNIF | --- | Clear significance flag |
EO$ADJUST_INPUT | len | Adjust source length |
EO$END | --- | End edit |
Hex | Symbol | Notes |
---|---|---|
00 | EO$END | --- |
01 | EO$END_FLOAT | --- |
02 | EO$CLEAR_SIGNIF | --- |
03 | EO$SET_SIGNIF | --- |
04 | EO$STORE_SIGN | --- |
05...1F | --- | Reserved to Digital |
20...3F | --- | Reserved for all time |
40 | EO$LOAD_FILL | Character is in next byte |
41 | EO$LOAD_SIGN | Character is in next byte |
42 | EO$LOAD_PLUS | Character is in next byte |
43 | EO$LOAD_MINUS | Character is in next byte |
44 | EO$INSERT | Character is in next byte |
45 | EO$BLANK_ZERO | Unsigned length is in next byte |
46 | EO$REPLACE_SIGN | Unsigned length is in next byte |
47 | EO$ADJUST_INPUT | Unsigned length is in next byte |
48...5F | --- | Reserved to Digital |
60...7F | --- | Reserved to CSS and customers |
80,90,A0 | --- | Reserved to Digital |
81...8F | EO$FILL | --- |
91...9F | EO$MOVE | Repeat count is <3:0> |
A1...AF | EO$FLOAT | --- |
B0...FE | --- | Reserved to Digital |
FF | --- | Reserved for all time |
Previous | Next | Contents | Index |
Copyright © Compaq Computer Corporation 1998. All rights reserved. Legal |
4515PRO_028.HTML
|