bcdadd.
Binary Coded Decimal Add Record
bcdadd. VRT,RA,RB
Adds two packed decimal integers and updates the condition register.
Details
The bcdadd. instruction adds two binary coded decimal numbers stored in vector registers VRA and VRB, and stores the result in vector register VRT. The PS field specifies whether to set the sign code to 0b1100 or 0b1111 if the unbounded result is zero.
Pseudocode Operation
Programming Note
When bit 3 of CR field 6 is set to 1 by bcdadd. or bcdsub., either an overflow occurred or one or both operands are not valid encodings of decimal values.
Example
bcdadd. v1, r4, r5
Encoding
Binary Layout
0
0
VRT
6
VRA
30
VRB
31
PS
Operands
-
VRT
Target Vector Storage Register -
RA
Source General Purpose Register containing the first packed decimal integer -
RB
Source General Purpose Register containing the second packed decimal integer -
VRA
Source Vector Register -
VRB
Source Vector Register -
PS
Programmable Sign Code -
vTmp
Target Vector-Scalar Register -
vA
Source Vector-Scalar Register -
vB
Source Vector-Scalar Register -
RT
Target General Purpose Register