|
|
Updated:
11 December 1998
|
VAX MACRO and Instruction Set Reference Manual
ADDP
Add Packed
Format
opcode addlen.rw, addaddr.ab, sumlen.rw,
sumaddr.ab
opcode add1len.rw, add1addr.ab, add2len.rw,
add2addr.ab, sumlen.rw, sumaddr.ab
Condition Codes
N|| <--- {sum string} LSS 0;
|
|
Z|| <--- {sum string} EQL 0;
|
|
V|| <--- {decimal overflow};
|
|
C|| <--- 0;
|
|
Exceptions
- reserved operand
- decimal overflow
Opcodes
20
|
ADDP4
|
Add Packed 4 Operand
|
21
|
ADDP6
|
Add Packed 6 Operand
|
Description
In 4 operand format, the addend string specified by the addend length
and addend address operands is added to the sum string specified by the
sum length and sum address operands, and the sum string is replaced by
the result.
In 6 operand format, the addend1 string specified by the addend1 length
and addend1 address operands is added to the addend2 string specified
by the addend2 length and addend2 address operands. The sum string
specified by the sum length and sum address operands is replaced by the
result.
Notes
- After execution of ADDP4:
R0 =
|
0
|
R1 =
|
Address of the byte containing the most significant digit of the addend
string
|
R2 =
|
0
|
R3 =
|
Address of the byte containing the most significant digit of the sum
string
|
- After execution of ADDP6:
R0 =
|
0
|
R1 =
|
Address of the byte containing the most significant digit of the
addend1 string
|
R2 =
|
0
|
R3 =
|
Address of the byte containing the most significant digit of the
addend2 string
|
R4 =
|
0
|
R5 =
|
Address of the byte containing the most significant digit of the sum
string
|
- The sum string, R0 to R3 (or R0 to R5 for ADDP6) and the condition
codes are UNPREDICTABLE if: the sum string overlaps the addend,
addend1, or addend2 strings; the addend, addend1, addend2, or sum (4
operand only) strings contain an invalid nibble; or a reserved operand
abort occurs.
ASHP
Arithmetic Shift and Round Packed
Format
opcode cnt.rb, srclen.rw, srcaddr.ab, round.rb,
dstlen.rw, dstaddr.ab
Condition Codes
N|| <--- {dst string} LSS 0;
|
|
Z|| <--- {dst string} EQL 0;
|
|
V|| <--- {decimal overflow};
|
|
C|| <--- 0;
|
|
Exceptions
- reserved operand
- decimal overflow
Opcodes
F8
|
ASHP
|
Arithmetic Shift and Round Packed
|
Description
The source string specified by the source length and source address
operands is scaled by a power of 10 specified by the count operand. The
destination string specified by the destination length and destination
address operands is replaced by the result.
A positive count operand effectively multiplies, a negative count
effectively divides, and a zero count just moves and affects condition
codes. When a negative count is specified, the result is rounded using
the round operand.
Notes
- After execution:
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
|
- The destination string, R0 to R3, and the condition codes are
UNPREDICTABLE if the destination string overlaps the source string, the
source string contains an invalid nibble, or a reserved operand abort
occurs.
- When the count operand is negative, the result is rounded by
decimally adding bits 3:0 of the round operand to the most significant
low-order digit discarded and propagating the carry, if any, to
higher-order digits. Both the source operand and the round operand are
considered to be quantities of the same sign for the purpose of this
addition.
- If bits 7:4 of the round operand are nonzero, or if bits 3:0 of the
round operand contain an invalid packed decimal digit, the result is
UNPREDICTABLE.
- When the count operand is zero or positive, the round operand has
no effect on the result except as specified in note 4.
- The round operand is normally 5. Truncation can be accomplished by
using a zero round operand.
CMPP
Compare Packed
Format
3operand: opcode len.rw, src1addr.ab,
src2addr.ab
4operand: opcode src1len.rw, src1addr.ab,
src2len.rw, src2addr.ab
Condition Codes
N|| <--- {src1 string} LSS {src2 string};
|
|
Z|| <--- {src1 string} EQL {src2 string};
|
|
V|| <--- 0;
|
|
C|| <--- 0;
|
|
Exceptions
Opcodes
35
|
CMPP3
|
Compare Packed 3 Operand
|
37
|
CMPP4
|
Compare Packed 4 Operand
|
Description
In 3 operand format, the source 1 string specified by the length and
source 1 address operands is compared to the source 2 string specified
by the length and source 2 address operands. The only action is to
affect the condition codes.
In 4 operand format, the source 1 string specified by the source 1
length and source 1 address operands is compared to the source 2 string
specified by the source 2 length and source 2 address operands. The
only action is to affect the condition codes.
Notes
- After execution of CMPP3 or CMPP4:
R0 =
|
0
|
R1 =
|
Address of the byte containing the most significant digit of string1
|
R2 =
|
0
|
R3 =
|
Address of the byte containing the most significant digit of string2
|
- R0 to R3 and the condition codes are UNPREDICTABLE if the source
strings overlap, if either string contains an invalid nibble, or if a
reserved operand abort occurs.
CVTLP
Convert Long to Packed
Format
opcode src.rl, dstlen.rw, dstaddr.ab
Condition Codes
N|| <--- {dst string} LSS 0;
|
|
Z|| <--- {dst string} EQL 0;
|
|
V|| <--- {decimal overflow};
|
|
C|| <--- 0;
|
|
Exceptions
- reserved operand
- decimal overflow
Opcodes
F9
|
CVTLP
|
Convert Long to Packed
|
Description
The source operand is converted to a packed decimal string. The
destination string operand specified by the destination length and
destination address operands is replaced by the result.
Notes
- After execution:
R0 =
|
0
|
R1 =
|
0
|
R2 =
|
0
|
R3 =
|
Address of the byte containing the most significant digit of the
destination string
|
- The destination string, R0 to R3, and the condition codes are
UNPREDICTABLE on a reserved operand abort.
- Overlapping operands produce correct results.
CVTPL
Convert Packed to Long
Format
opcode srclen.rw, srcaddr.ab, dst.wl
Condition Codes
N|| <--- dst LSS 0;
|
|
Z|| <--- dst EQL 0;
|
|
V|| <--- {integer overflow};
|
|
C|| <--- 0;
|
|
Exceptions
- reserved operand
- integer overflow
Opcodes
36
|
CVTPL
|
Convert Packed to Long
|
Description
The source string specified by the source length and source address
operands is converted to a longword, and the destination operand is
replaced by the result.
Notes
- After execution:
R0 =
|
0
|
R1 =
|
Address of the byte containing the most significant digit of the source
string
|
R2 =
|
0
|
R3 =
|
0
|
- The destination operand, R0 to R3, and the condition codes are
UNPREDICTABLE on a reserved operand abort, or if the string contains an
invalid nibble.
- The destination operand is stored after the registers are updated
as specified in note 1. You may use R0 to R3 as the destination operand.
- If the source string has a value outside the range --2,147,483,648
to +2,147,483,647, integer overflow occurs and the destination operand
is replaced by the low-order 32 bits of the correctly signed infinite
precision conversion. On overflow, the sign of the destination may be
different from the sign of the source.
- Overlapping operands produce correct results.
CVTPS
Convert Packed to Leading Separate Numeric
Format
opcode srclen.rw, srcaddr.ab, dstlen.rw, dstaddr.ab
Condition Codes
N|| <--- {src string} LSS 0;
|
|
Z|| <--- {src string} EQL 0;
|
|
V|| <--- {decimal overflow};
|
|
C|| <--- 0;
|
|
Exceptions
- reserved operand
- decimal overflow
Opcodes
08
|
CVTPS
|
Convert Packed to Leading Separate Numeric
|
Description
The source packed decimal string specified by the source length and
source address operands is converted to a leading separate numeric
string. The destination string specified by the destination length and
destination address operands is replaced by the result.
Conversion is effected by replacing the lowest-addressed byte of the
destination string with the ASCII character "+" or
"--", determined by the sign of the source string. The
remaining bytes of the destination string are replaced by the ASCII
representations of the values of the corresponding packed decimal
digits of the source string.
Notes
- After execution:
R0 =
|
0
|
R1 =
|
Address of the byte containing the most significant digit of the source
string
|
R2 =
|
0
|
R3 =
|
Address of the sign byte of the destination string
|
- The destination string, R0 to R3, and the condition codes are
UNPREDICTABLE if the destination string overlaps the source string, the
source string contains an invalid nibble, or a reserved operand abort
occurs.
- This instruction produces an ASCII "+" or "--"
in the sign byte of the destination string.
- If decimal overflow occurs, the value stored in the destination
might be different from the value indicated by the condition codes (Z
and N bits).
- If the conversion produces a --0 without overflow, the destination
leading separate numeric string is changed to a +0 representation.
CVTPT
Convert Packed to Trailing Numeric
Format
opcode srclen.rw, srcaddr.ab, tbladdr.ab, dstlen.rw,
dstaddr.ab
Condition Codes
N|| <--- {src string} LSS 0;
|
|
Z|| <--- {src string} EQL 0;
|
|
V|| <--- {decimal overflow};
|
|
C|| <--- 0;
|
|
Exceptions
- reserved operand
- decimal overflow
Opcodes
24
|
CVTPT
|
Convert Packed to Trailing Numeric
|
Description
The source packed decimal string specified by the source length and
source address operands is converted to a trailing numeric string. The
destination string specified by the destination length and destination
address operands is replaced by the result. The condition code N and Z
bits are affected by the value of the source packed decimal string.
Conversion is effected by using the highest-addressed byte of the
source string (the byte containing the sign and the least significant
digit), even if the source string value is --0. The assembler uses this
byte as an unsigned index into a 256-byte table whose first entry
(entry number 0) address is specified by the table address operand. The
byte read from the table replaces the least significant byte of the
destination string. The remaining bytes of the destination string are
replaced by the ASCII representations of the values of the
corresponding packed decimal digits of the source string.
Notes
- After execution:
R0 =
|
0
|
R1 =
|
Address of the byte containing the most significant digit of the source
string
|
R2 =
|
0
|
R3 =
|
Address of the most significant digit of the destination string
|
- The destination string, R0 to R3, and the condition codes are
UNPREDICTABLE if the destination string overlaps the source string or
the table; if the source string or the table contains an invalid
nibble; or if a reserved operand abort occurs.
- The condition codes are computed on the value of the source string
even if overflow results. In particular, condition code N is set only
if the source is nonzero and contains a minus sign (--).
- By appropriate specification of the table, you can convert any form
of trailing numeric string. See Chapter 8 for the preferred form of
trailing overpunch, zoned and unsigned data. In addition, the table can
be set up for absolute value, negative absolute value, or negated
conversions. The translation table may be referenced even if the length
of the destination string is zero.
- Decimal overflow occurs if the destination string is too short to
contain the converted result of a nonzero packed decimal source string
(not including leading zeros). Conversion of a source string with zero
value never results in overflow; conversion of a nonzero source string
to a zero-length destination string results in overflow.
- If decimal overflow occurs, the value stored in the destination may
be different from the value indicated by the condition codes (Z and N
bits).
CVTSP
Convert Leading Separate Numeric to Packed
Format
opcode srclen.rw, srcaddr.ab, dstlen.rw, dstaddr.ab
Condition Codes
N|| <--- {dst string} LSS 0;
|
|
Z|| <--- {dst string} EQL 0;
|
|
V|| <--- {decimal overflow};
|
|
C|| <--- 0;
|
|
Exceptions
- reserved operand
- decimal overflow
Opcodes
09
|
CVTSP
|
Convert Leading Separate Numeric to Packed
|
Description
The source numeric string specified by the source length and source
address operands is converted to a packed decimal string, and the
destination string specified by the destination address and destination
length operands is replaced by the result.
Notes
- A reserved operand abort occurs if:
- The length of the source leading separate numeric string is outside
the range 0 to 31
- The length of the destination packed decimal string is outside the
range 0 to 31
- The source string contains an invalid byte. An invalid byte is any
character other than an ASCII "0" to "9" in a digit
byte or an ASCII "+", "<space>", or
"--" in the sign byte
- After execution:
R0 =
|
0
|
R1 =
|
Address of the sign byte of the source string
|
R2 =
|
0
|
R3 =
|
Address of the byte containing the most significant digit of the
destination string
|
- The destination string, R0 to R3, and the condition codes are
UNPREDICTABLE if the destination string overlaps the source string, or
if a reserved operand abort occurs.
- srclen is the length of the passed string minus
the sign byte.
CVTTP
Convert Trailing Numeric to Packed
Format
opcode srclen.rw, srcaddr.ab, tbladdr.ab, dstlen.rw,
dstaddr.ab
Condition Codes
N|| <--- {dst string}LSS 0;
|
|
Z|| <--- {dst string} EQL 0;
|
|
V|| <--- {decimal overflow};
|
|
C|| <--- 0;
|
|
Exceptions
- reserved operand
- decimal overflow
Opcodes
26
|
CVTTP
|
Convert Trailing Numeric to Packed
|
Description
The source trailing numeric string specified by the source length and
source address operands is converted to a packed decimal string, and
the destination packed decimal string specified by the destination
address and destination length operands is replaced by the result.
Conversion is effected by using the highest-addressed (trailing) byte
of the source string as an unsigned index into a 256-byte table whose
first entry (entry number 0) is specified by the table address operand.
The byte read from the table replaces the highest-addressed byte of the
destination string (the byte containing the sign and the least
significant digit). The remaining packed digits of the destination
string are replaced by the low-order 4 bits of the corresponding bytes
in the source string.
Notes
- A reserved operand abort occurs if:
- The length of the source trailing numeric string is outside the
range 0 to 31
- The length of the destination packed decimal string is outside the
range 0 to 31
- The source string contains an invalid byte. An invalid byte is any
value other than ASCII "0" to "9" in any high-order
byte (that is, any byte except the least significant byte)
- The translation of the least significant digit produces an invalid
packed decimal digit or sign nibble
- After execution:
R0 =
|
0
|
R1 =
|
Address of the most significant digit of the source string
|
R2 =
|
0
|
R3 =
|
Address of the byte containing the most significant digit of the
destination string
|
- The destination string, R0 to R3, and the condition codes are
UNPREDICTABLE if the destination string overlaps the source string or
the table, or if a reserved operand abort occurs.
- If the convert instruction produces a --0 without overflow, the
destination packed decimal string is changed to a +0 representation,
condition code N is cleared, and Z is set.
- If the length of the source string is zero, the destination packed
decimal string is set equal to zero, and the translation table is not
referenced.
- By appropriate specification of the table, you can convert any form
of trailing numeric string. See Chapter 8 for the preferred form of
trailing overpunch, zoned and unsigned data. In addition, the table can
be set up for absolute value, negative absolute value, or negated
conversions.
- If the table translation produces a sign nibble containing any
valid sign, the preferred sign representation is stored in the
destination packed decimal string.