Move Numeric (MVN)/OP=11

Format

OP AF BF A Syllable B Syllable

OP = 11

AF length of the A Syllable. A value of 00 is equal to a length of 100 units (digits or characters as specified by the A address controller). AF may be indirect or may indicate the A Syllable is a literal.
BF length of the B Syllable. A value of 00 is equal to a length of 100 units (digits or characters as specified by the B address controller). BF may be indirect.

The A Syllable is the address of the source data field. Address may be indexed, indirect or extended. Data types may be UN, UA or SN.
The B Syllable is the address of the destination data field. Address may be indexed, indirect or extended. Data types may be UN, UA or SN.

Function

The Move Numeric instruction moves digits or characters, depending on the address controllers, from one location in memory to another memory location, right justified.

AF > BF

If the source data field is longer than the destination data field (AF > BF), examine the high order numeric digits of the source data field for non-zero content. If these digits are non-zero, set the Overflow Flag and terminate the instruction with no further action. If these digits are zero, left truncate the source field and move the remainder of the field.

AF < BF

If the source data field is shorter than the destination data field (AF < BF), the data is right justified in the destination data field and padded with leading zero digits in the cases of UN and SN or EBCDIC zero characters (F0) in the case of UA.

UA to UA

When both address controllers specify 8-bit format (UA - UA), move the numeric portion of each character in the source data field to the destination data field with the zone digit set to the standard EBCDIC numeric subset code (F).

UN to UN

When both address controllers specify unsigned 4-bit format (UN - UN), move each digit.

SN to SN

When both address controllers specified signed 4-bit format (SN - SN), move each digit and set the sign of the destination data filed to the standard EBCDIC form (C = positive, D = negative) of the sign of the source data field. Note that a negative zero remains a negative zero.

UA to UN

When the A and B address controllers specify UA and UN respectively, only move the low-order digit of each character in the source data field to the destination data field.

UA to SN

When the A and B address controllers specify UA and SN respectively, only move the low order digit of each character in the source data field to the destination data field. Set the sign of the destination data field to the standard EBCDIC sign for the interpreted value of the sign located in the most significant digit of the source data field.

UN to UA

When the A and B address controllers specify UN and UA respectively, move each digit and set the zone (high order) digit of the character to be stored in the destionation data field to the standard EBCDIC numeric subset code (F).

UN to SN

When the A and B address controllers specify UN and SN respectively, move each digit and set the sign of the destionation data field to the standard EBCDIC positive sign code (C).

SN to UN

When the A and B address controllers specify SN and UN respectively, move each digit and ignore the sign of the source data field except for setting the Comparison Flags;

SN to UA

When the A and B address controllers specify SN and UA respectively, move each digit and set the zone (high order) digit of the character to be stored in the destination data field to the standard EBCDIC numeric subset code (F). The most significant digit of the destination data field is set to the standard EBCDIC form of the sign of the source field.

Comparison Flags

Set the Comparison Flags to HIGH if the numeric digits moved from the source data field are non-zero and the sign of the source field is interpreted as positive.

Set the Comparison Flags to EQUAL if the numeric digits moved from the source data field are all zero.

Set the Comparison Flags to LOW if the numeric digits moved from the source data field are non-zero and the sign of the source field is interpreted as negative.

Note

Move Numeric UA-UA and UA-UN cause incompatible result in the final Comparison Flags. See Compatibility Notes A.04.2.

Overlap

When the A and B address controllers indicate UN data, the field lengths are equal (AF = BF) and the value of the final B address is one greater than the final A address, repeat the first digit of the source data field throughout the destination data field.

Cases of overlaping A and B, other than described above, may produce inconsistent results. See Compatibility Notes A.04.

Examples

Example (1) Move Numeric Field to shorter Numeric Field

OP AF BF A Syllable B Syllable
11 05 03 A Field UN B Field UN
                    BEFORE              AFTER
   A Field           00123            unchanged
   B Field             nnn                123
   Comparison Flags   nn                 HIGH
   Overflow Flag      nn              unchanged

Example (2) Move Numeric Field to longer Numeric Field

OP AF BF A Syllable B Syllable
11 03 05 A Field SN B Field SN
                    BEFORE              AFTER
   A Field           +123             unchanged
   B Field          nnnnnn             C00123
   Comparison Flags   nn                 HIGH
   Overflow Flag      nn              unchanged

Example (3) Move a Numeric field with an Overflow condition

OP AF BF A Syllable B Syllable
11 05 03 A Field UN B Field UN
                    BEFORE              AFTER
   A Field           12300            unchanged
   B Field             nnn            unchanged
   Comparison Flags   nn              unchanged
   Overflow Flag      nn                 ON

Example (4) Move an Alpha field to an Alpha field

OP AF BF A Syllable B Syllable
11 03 03 A Field UA B Field UA
                    BEFORE              AFTER
   A Field          C2D4E9            unchanged
   B Field          nnnnnn             F2F4F9
   Comparison Flags   nn                HIGH
   Overflow Flag      nn              unchanged

Example (5) Repeat first digit

OP AF BF A Syllable B Syllable
1l 05 05 A Field UA A Field + 1 UA
                    BEFORE             AFTER
   A Field          6nnnnn            666666
   Comparison Flags   nn                HIGH
   Overflow Flag      nn              unchanged

Example (6) Move Alpha Field to Signed Field

OP AF BF A Syllable B Syllable
11 03 03 A Field UA B Field SN
                    BEFORE              AFTER
   A Field         D1C0F3             unchanged
   B Field           nnnn               D103
   Comparison Flags   nn                 LOW
   Overflow Flag      nn              unchanged

Example (7) Move Signed field to Alpha Field

OP AF BF A Syllable B Syllable
11 03 03 A Field SN B Field UA
                    BEFORE              AFTER
   A Field           +123             unchanged
   B Field         nnnnnn               C1F2F3
   Comparison Flags   nn                HIGH
   Overflow Flag      nn              unchanged
instructions/mvn.txt · Last modified: 2008/05/13 07:22 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki