Edit and Edit and Mark
The following examples show the step-by-step editing
of a packed field with a length specification of four
against a pattern 13 bytes long. The following symbols
are used:SYMDOL b
(
)
d
Assume:
MEANING
blank character
significance start characterfield separator character
digit-select character
Loc1000-1012 (first operand)
Loc120-1203 (second operand)
Reg120 bdd,dd ( .ddbCR 02 57 42 6+ 00 00 10 00 The instruction is: OpCode D. and provides the following:
PATTERN DIGITS TRIGGER RULE LOCATION 1000-1012 b o leave(l)bdd, dd(. ddbCR d 0 o fill hhd, dd(. ddbCR d 2 1 digit bh2, dd(. ddbCR(2) 1 leave same
1 digit bh2, 5d(.ddbCR d 5
d 7 1 digit bb2, 57 (.ddbCR ( 4 1 digit bh2, 574. ddbCR 1 leave same
d 2 1 digit bb2, 574.2bdCR d 6+ o digit bb2, 574. 26bCR (3)
b ofill same C o fill bh2, 574, 26bbR
R ofill bb2,574,26bbb
Thus:
Loc1000-1012 (after) bb2,574.26bCR NOTES 1. This character is saved as the fill character.
2. First nonzero digit setsS trigger to 1.
3.Plus sign in this same byte sets S trigger to zero.
Condition code = 2; result greater than zero.
If the second operand in location1200-1203 is 00 00 02 6-, the following results are obtained:
Loc1000-1012 (before) hdd, dd(. ddbCR Loc 1000-1012 (after) bbbbbbb. 26hCR Condition code = 1; result less than zero.
In this case the significance-start character in the
pattern causes the decimal point to be left unchanged.
The minus sign does not reset theS trigger so that
thecn symbol is also preserved.
In the edit examples above, if the initial character
of the pattern was an asterisk, then asterisk-protec
tion would be achieved.
In the same example, if EDIT AND MARK was used:
Reg 1 (before)00 12 34 56
Reg 1 (after)00 00 10 02 Branch On Condition Assume a prior operation has been perfonned which
resulted in setting the condition code in the psw. The
program is to branch if the result of the previous
operation is nonzero.
The BRANCHON CONDITION with a mask of 0111 == 7 10 in the Ml field becomes a branch-on-nonzero
instruction.
Reg 500000100 Reg 12 00040000 The instruction is: Op Code Ml X2 B2 D, Be 7 5 12 100 and causes a branch to location 40,200, provided the condition
code is not zero.Condition code setting is unchanged.
Execute
The ADD instruction at location350 is to be executed
by means of EXECUTE:
Assume:
Reg 3
Reg 12
Loc350 The instruction is: Op Code
EX o
X 2
300 00 00 10 00 00 03 30 AR 4,6
12
D210 The CPU executes the ADD instruction and takes the
next sequential instruction afterEXECUTE. The move character instruction MVC at location 1200 is to be executed, and the number of characters to be
moved is computed in register 5.
Assume:
Reg 5 (rightmost 8 bits)
Reg 7
Reg 13
Loc1200 Length field (8 bits) =
The instruction is:Op Code Rl X 2 EX 5 7 01110000 = 11210 00 00 00 50 00 00 10 50 MVC 0, 15, 100, 12, 1000 00000000 B2
13100 The rightmost eight bits of R5 arc OR' cd with the
length portion (positions 8-15) of the instruction being
executed, at location1200 prior to execution of MOVE. However, the actual instruction at location 1200 re-
Appendix A 127
The following examples show the step-by-step editing
of a packed field with a length specification of four
against a pattern 13 bytes long. The following symbols
are used:
(
)
d
Assume:
MEANING
blank character
significance start character
digit-select character
Loc
Loc
Reg
PATTERN DIGIT
1 digit bh2, 5d(.
d 7 1 digit bb2, 57 (.
d 2 1 digit bb2, 574.
b o
R o
Thus:
Loc
2. First nonzero digit sets
3.
Condition code = 2; result greater than zero.
If the second operand in location
Loc
In this case the significance-start character in the
pattern causes the decimal point to be left unchanged.
The minus sign does not reset the
the
In the edit examples above, if the initial character
of the pattern was an asterisk, then asterisk-protec
tion would be achieved.
In the same example, if EDIT AND MARK was used:
Reg 1 (before)
Reg 1 (after)
resulted in setting the condition code in the psw. The
program is to branch if the result of the previous
operation is nonzero.
The BRANCH
instruction.
Reg 5
code is not zero.
Execute
The ADD instruction at location
by means of EXECUTE:
Assume:
Reg 3
Reg 12
Loc
EX o
X 2
3
12
D2
next sequential instruction after
moved is computed in register 5.
Assume:
Reg 5 (rightmost 8 bits)
Reg 7
Reg 13
Loc
The instruction is:
13
length portion (positions 8-15) of the instruction being
executed, at location
Appendix A 127