3. Instructions
418
CS/CJ/NSJ Series Instructions Reference Manual (W474)
Example Programming
z BINS
BCD Format 0 (C=#0000)
When CIO 0.00 is ON in the following example, the signed BCD data format and range in D100 are
checked against the format specified in the control word (0000). The source data is correct, so the
signed BCD data in D100 is converted to signed binary and output to D200.
BCD Format 3 (C=#0003)
When CIO 0.01 is ON in the following example, the signed BCD data format and range in D100 are
checked against the format specified in the control word (0003). The source data is correct, so the
signed BCD data in D300 is converted to signed binary and output to D400.
z BISL
BCD Format 2 (C=#0002)
When CIO 0.00 is ON in the following example, the double signed BCD data format and range in D101
and D100 are checked against the format specified in the control word (2). The source data is correct,
so the double signed BCD data in D101 and D100 is converted to double signed binary and output to
D201 and D200.
i
S: D100
1 1 2 3
D: D200
F F 8 5
0.00
D100
D200
Signed binary data
Signed BCD data (–123)
S: D300
A 3 6 9
D: D400
F A A 7
0.01
D300
D400
Signed BCD data
(–1,369)
Signed binary data
F 3 4 5
F F C B
6 7 8 9
4 0 E B
S+1: D101
D+1: D201
S: D100
D: D200
0.00
D100
D200
Double signed BCD data
(–3,456,789)
Double signed binary data