Copy Numeric Value (CPYNV)

Instruction Syntax

Op Code (Hex) Extender Operand 1 Operand 2 Operand [3-6]
CPYNV 1042 Receiver Source
CPYNVR 1242 Receiver Source
CPYNVB 1C42 Branch options Receiver Source Branch targets
CPYNVBR 1E42 Branch options Receiver Source Branch targets
CPYNVI 1842 Indicator options Receiver Source Indicator targets
CPYNVIR 1A42 Indicator options Receiver Source Indicator targets

Operand 1: Numeric variable scalar or data-pointer-defined numeric scalar.

Operand 2: Numeric scalar or data pointer-defined-numeric scalar.

Operand 3-6:

  • Branch Form–Branch point, instruction pointer, relative instruction number, or absolute instruction number.
  • Indicator Form–Numeric variable scalar or character variable scalar.

Bound Program Access
Built-in number for LBCPYNV is 129.
LBCPYNV (
  receiver              : address of signed binary OR
                          address of unsigned binary OR
                          address of zoned decimal (1 to 63 digits) OR
                          address of packed decimal (1 to 63 digits) OR
                          address of binary floating-point OR
                          address of decimal floating-point
  receiver_attributes   : address (See SETDPAT for format of attributes)
  source                : address of signed binary OR
                          address of unsigned binary OR
                          address of zoned decimal (1 to 63 digits) OR
                          address of packed decimal (1 to 63 digits) OR
                          address of binary floating-point OR
                          address of decimal floating-point
  source_attributes     : address (See SETDPAT for format of attributes)
)
 
-- OR --
 
Built-in number for LBCPYNVR is 478.
 
LBCPYNVR (
  receiver              : address of signed binary OR
                          address of unsigned binary OR
                          address of zoned decimal (1 to 63 digits) OR
                          address of packed decimal (1 to 63 digits)
  receiver_attributes   : address (See SETDPAT for format of attributes)
  source                : address of signed binary OR
                          address of unsigned binary OR
                          address of zoned decimal (1 to 63 digits) OR
                          address of packed decimal (1 to 63 digits) OR
                          address of binary floating-point OR
                          address of decimal floating-point
  source_attributes     : address (See SETDPAT for format of attributes)
)

Description:

The numeric value of the source operand is copied to the numeric receiver operand.

Both operands must be numeric. If necessary, the source operand is converted to the same type as the receiver operand before being copied to the receiver operand. The source value is adjusted to the length of the receiver operand, aligned at the assumed decimal point of the receiver operand, or both before being copied to it. Length adjustment and decimal point alignment are performed according to the rules of arithmetic operations outlined in the Arithmetic Operations. If significant digits are truncated on the left end of the source value, a size (hex 0C0A) exception is signaled. When the receiver is binary, the size (hex 0C0A) exception may be suppressed using program creation options or by changing the suppress binary size exception attribute program attribute using the Override Program Attributes (OVRPGATR) instruction.

If a decimal to binary conversion causes a size (hex 0C0A) exception to be signaled or if the size (hex 0C0A) exception is suppressed, the binary value contains the correct truncated result only if the decimal value contains 15 or fewer significant nonfractional digits.

If the source is a fixed-point decimal value, it is validated for valid decimal sign and digit codes. The decimal data (hex 0C02) exception is signalled if any invalid values are encountered, and the operation is terminated. If an even number of digits was specified, the most significant digit position of the source is not validated and is not used as part of the fixed-point decimal value.

Conversions between floating-point integers and integer formats (binary or decimal with no fractional digits) is exact, except when an exception is signaled.

An invalid floating-point conversion (hex 0C0C) exception is signaled when an attempt is made to convert from floating-point to binary or decimal and the result would represent infinity or NaN, or nonzero digits would be truncated from the left end of the resultant value.

For the optional round form of the instruction, a floating-point receiver operand is invalid.

For a fixed-point operation, if significant digits are truncated from the left end of the source value, a size (hex 0C0A) exception is signaled.

For a floating-point receiver, if the exponent of the resultant value is too large or too small to be represented in the receiver field, the floating-point overflow (hex 0C06) exception and floating-point underflow (hex 0C07) exception are signaled, respectively.

When either the source or the receiver is of decimal floating-point type, CPYNV and the other non-bound program forms must be provided data-pointer access to that scalar.

Conversions to a decimal floating-point receiver are governed, where required, by the current decimal floating-point rounding mode. Conversions to a binary floating-point receiver are governed, where required, by the current binary floating-point rounding mode. A floating-point inexact result (hex 0C0D) exception is signalled when rounding occurs.

Copying a 16-byte decimal floating-point SNaN value to an 8-byte decimal floating-point receiver, or copying an 8-byte decimal floating-point SNaN value to a 16-byte decimal floating-point receiver, will result in a floating-point invalid operand (hex 0C09) exception being signalled.

Resultant Conditions

  • Positive–The algebraic value of the numeric scalar receiver operand is positive.
  • Negative–The algebraic value of the numeric scalar receiver operand is negative.
  • Zero–The algebraic value of the numeric scalar receiver operand is zero.
  • Unordered–The value assigned a floating-point receiver operand is NaN.

Authorization Required

  • None

Lock Enforcement

  • None

Exceptions

  • 06 Addressing
    • 0601 Space Addressing Violation
    • 0602 Boundary Alignment
    • 0603 Range
    • 0604 External Data Object Not Found
  • 08 Argument/Parameter
    • 0801 Parameter Reference Violation
  • 0C Computation
    • 0C02 Decimal Data
    • 0C06 Floating-Point Overflow
    • 0C07 Floating-Point Underflow
    • 0C09 Floating-Point Invalid Operand
    • 0C0A Size
    • 0C0C Invalid Floating-Point Conversion
    • 0C0D Floating-Point Inexact Result
  • 10 Damage Encountered
    • 1004 System Object Damage State
    • 1044 Partial System Object Damage
  • 1C Machine-Dependent
    • 1C03 Machine Storage Limit Exceeded
  • 20 Machine Support
    • 2002 Machine Check
    • 2003 Function Check
  • 22 Object Access
    • 2201 Object Not Found
    • 2202 Object Destroyed
    • 2203 Object Suspended
    • 2208 Object Compressed
    • 220B Object Not Available
  • 24 Pointer Specification
    • 2401 Pointer Does Not Exist
    • 2402 Pointer Type Invalid
  • 2C Program Execution
    • 2C04 Branch Target Invalid
  • 2E Resource Control Limit
    • 2E01 User Profile Storage Limit Exceeded
  • 32 Scalar Specification
    • 3201 Scalar Type Invalid
  • 36 Space Management
    • 3601 Space Extension/Truncation
  • 44 Protection Violation
    • 4401 Object Domain or Hardware Storage Protection Violation
    • 4402 Literal Values Cannot Be Changed