Download Print this page

IBM 4300 Manual page 280

Processors principles of operation for ecps: vse mode
Hide thumbs Also See for 4300:

Advertisement

Assume that the source and pattern fields are:
Source
1200
1203
10215714216CI
Pattern
1000
L+
100C
140\20\20\6B\2012112014BI20120\40\C3Io91
b d
d
d
( d
d
d b
C R
Execution of the instruction (assume that
register 12 contains 00 00 10 00):
Machine Format
Op
Code
L
DE
OC
c 1 0001
Assembler Format
ED
0(13,12),X ' 200 ' (12)
alters the pattern field as follows:
Significance
Indicator
Location
Pattern
Digit
(Before/After)
Rule
tOOO-tOOC
b
off/off
leave(t)
bdd,d(d.ddbCR
d
0
off /off
fill
bbd,d(d.ddbCR
d
2
off/on(2)
dig i t
bb2,d(d.ddbCR
d
on/on
leave
same
5
on/on
di g i t
bb2,5(d.ddbCR
(
7
on/on
digit
bb2,57d.ddbCR
d
4
on/on
digit
bb2,574.ddbCR
d
on/on
leave
same
2
on/on
digit
bb2,574.2dbCR
d
6+
on/off(3)
digit
bb2,574.26bCR
b
off/off
fill
same
C
off/off
fill
bb2,574.26bbR
R
off/off
fill
bb2,574.26bbb
Notes:
1.
This character is the fill byte.
2.
First nonzero decimal source digit turns on Significance
indicator.
3.
Plus sign in the four rightmost bits of the byte turns
off significance indicator.
Thus, after the instruction is executed, the
pattern field contains the result as follows:
Pattern
1000
100C
1401401F216BIF51F71F414BIF21F6140\401401
b
b
2
574
2
6
b
b
b
When printed, the new pattern field appears as:
2,574.26
The source field remains unchanged. Condition
code 2 is set because the number was greater than
zero.
If
the number in the source field is changed to
00 00 02 6D, a negative number, and the original
pattern is used, the edited result this time is:
Pattern
1000
100C
140140140140140140lFol4BIF21F6140lC31091
b
b
b
b
b
b
0
2
6
b
C
R
This pattern field prints as:
0.26 CR
The significance starter forces the significance
indicator to the on state and hence causes the
decimal point to be preserved. Because the
minus-sign code has no effect on the significance
indicator, the characters CR are printed to show a
negative (credit) amount.
Condition code 1 is set (number less than zero).
EDIT AND MARK (EDMK)
The EDIT AND MARK instruction may be used, in
addition to the functions of EDIT, to insert a
currency symbol, such as a dollar sign, at the
appropriate position in the edited result. Assume
the same source in storage locations 1200-1203,
the same pattern in locations 1000-1 OOC, and the
same contents of general register 12 as for the
EDIT instruction above. The previous contents of
general register 1 are immaterial; a LOAD
ADDRESS instruction is used to set up the first
digit position that is forced to print if no significant
digits occur to the left.
The instructions:
LA
1,6(0,12)
EDMK0(13, 12),X'200'( 12)
BCTR1,0
MVI O(1),C'$'
Load address of forced
significant digit into OR!.
Leave address of first
significant digit in OR 1.
Subtract 1 from address in
OR!.
Store dollar sign and address
in ORl.
. Appendix A. Number Representation and Instruction-Use Examples
A-27

Advertisement

loading