![background image](http://html1.mh-extra.com/html/omron/sysmac-cs1d-cpu/sysmac-cs1d-cpu_reference-manual_742268558.webp)
519
Conversion Instructions
Section 3-12
Description
BINS(470) converts signed BCD data to signed binary data. First the signed
BCD data format and range in word S are checked against the setting in the
control word (C). If the source data is correct, the signed BCD data in S is
converted to signed binary and output to D. If the source data is incorrect, the
Error Flag will be turned ON and the instruction will not be executed.
When the converted data is negative, it will be output as the 2’s complement
and the Negative Flag be will turned ON. NEG(160) can be used to determine
the absolute value of a negative signed binary number. Refer to
3-12-52’S
COMPLEMENT: NEG(160)
for details.
A value of –0 in the source data will be treated as 0 and will not cause an
error. Also, the status of bits 13 to 15 of S is not checked when C=0000.
Note
Some Special I/O Units output signed BCD data. Calculations using this data
will normally be easier if it is first converted to signed binary data with
BINS(470).
The control word specifies the signed BCD format as shown below.
C = 0000 (Input Data Range: –999 to 999 BCD)
C = 0001 (Input Data Range: –7999 to 7999 BCD)
C = 0002 (Input Data Range: –999 to 9999 BCD)
Index Registers
---
Indirect addressing
using Index Registers
,IR0 to ,IR15
–2048 to +2047 ,IR0 to –2048 to +2047 ,IR15
DR0 to DR15, IR0 to IR15
,IR0+(++) to ,IR15+(++)
,–(– –)IR0 to, –(– –)IR15
Area
C
S
D
Signed BCD
Signed binary
Signed BCD format
specified in C
3 digits BCD, 12 bits
Sign bit (0: Positive; 1: Negative)
Status of 3 bits: 0
Sign bit (0: Positive; 1: Negative)
3 bits of digit 4 (0 to 7)
3 digits BCD, 12 bits
3 digits BCD, 12 bits
0 to 9: Fourth digit BCD
F: Negative (
−
)
A to E: Error
Summary of Contents for SYSMAC CS1D-CPU**
Page 3: ...iv...
Page 29: ...xxx...
Page 185: ...146 List of Instructions by Function Code Section 2 4...
Page 1389: ...1350 CJ series Instruction Execution Times and Number of Steps Section 4 2...
Page 1390: ...1351 Appendix A ASCII Code Table ASCII SP Four leftmost bits Four rightmost bits...
Page 1391: ...1352 ASCII Code Table Appendix A...