The MVC instruction copies data from the second operand to the first operand. The value of the second operand is unchanged. The number of bytes copied is equal to the length of the first operand, unless it is specified explicitly.
Given the following definitions:
FIRST DS CL8 SECOND DS CL6 ONE DC CL6'ABCDEF' TWO DC CL4'1234' THREE DC CL3'XYZ' FOUR DC CL8'LMNOPQRS' FIVE DC C'135791' SIX DC C'A' SEVEN DC CL10'0123456789'
The following table shows the results of MVC instructions. Each instruction starts with the initial data given above.
Move Instruction | Contents of Operand 1 Before Move | Contents of Operand 1 After Move |
---|---|---|
Implicit Moves | ||
MVC SECOND,ONE | (garbage) | ABCDEF |
MVC FIRST,FOUR | (garbage) | LMNOPQRS |
MVC ONE,FIVE | ABCDEF | 135791 |
MVC FIRST,ONE | (garbage) | ABCDEF12 |
MVC ONE,THREE | ABCDEF | XYZLMN |
MVC THREE,ONE | XYZ | ABC |
MVC ONE,FOUR | ABCDEF | LMNOPQ |
Explicit Moves | ||
MVC ONE(3),TWO | ABCDEF | 123DEF |
MVC FOUR(6),TWO | LMNOPQRS | 1234XYRS |
MVC THREE(5),FIVE | XYZ | 135 FOUR changed to 79NOPQRS |
Move Instruction | Contents of Operand 1 Before Move | Contents of Operand 1 After Move |
---|---|---|
Self-Defining Operands | ||
MVC FIRST,=C'HI MOM!!' | (garbage) | HI MOM!! |
MVC TWO,=C'HI MOM!' | 1234 | HI M |
MVC FOUR(5),=C'HI MOM!' | LMNOPQRS | HI MOQRS |
MVC SECOND,=C'HI' | (garbage) | hi**** (last 4 bytes are garbage) |
Relative Addressing | ||
MVC ONE+3(3),THREE | ABCDEF | ABCXYZ |
MVC TWO,FOUR+4 | 1234 | PQRS |
MVC FOUR+3(3),TWO-1 | LMNOPQRS | LMNF12RS |
MVC THREE+1,FIVE+2 | XYZ | X57 FOUR changed to 9MNOPQRS |
Overlapping Fields | ||
MVC FOUR,THREE | LMNOPQRS | XYZXYZXY |
MVC SEVEN,SIX | 0123456789 | AAAAAAAAAA |
Email Me |
Office Hours |
My Home Page |
Department Home |
MCC Home Page
© Copyright Emmi Schatz 2003