Omron C28K Video Game Controller User Manual


 
115
5-15 Data Conversion
The conversion instructions convert word data that is in one format into an-
other format and output the converted data to specified result word(s). Con-
versions are available to convert between binary (hexadecimal) and BCD
and between multiplexed and non-multiplexed data. All of these instructions
change only the content of the words to which converted data is being
moved, i.e., the content of source words is the same before and after execu-
tion of any of the conversion instructions.
5-15-1 BCD-TO- BINARY – BIN(23)
S : Source word (BCD)
IR, SR, DM, HR, TC
R : Result word
IR, DM, HR
Ladder Symbol Operand Data Areas
BIN(23)
S
R
BIN(23) can be used to convert BCD to binary so that displays on the Pro-
gramming Console or any other programming device will appear in hexadeci-
mal rather than decimal. It can also be used to convert to binary to perform
binary arithmetic operations rather than BCD arithmetic operations, e.g.,
when BCD and binary values must be added.
ER: The content S is not BCD
EQ: ON when 0000 is placed in R.
5-15-2 BINARY-TO-BCD – BCD(24)
S : Source word (binary)
IR, SR, DM, HR, TC
R : Result word
IR, DM, HR
Ladder Symbol Operand Data Areas
BCD(24)
S
R
If the content of S exceeds 270F, the converted result would exceed 9999
and BCD(24) will not be executed. When the instruction is not executed, the
content of R remains unchanged.
BCD(24) converts the binary (hexadecimal) content of S into the numerically
equivalent BCD bits, and outputs the BCD bits to R. Only the content of R is
changed; the content of S is left unchanged.
BCD(24) can be used to convert binary to BCD so that displays on the Pro-
gramming Console or any other programming device will appear in decimal
rather than hexadecimal. It can also be used to convert to BCD to perform
BCD arithmetic operations rather than binary arithmetic operations, e.g.,
when BCD and binary values must be added.
ER: S is greater than 270F.
EQ: ON when 0000 is placed in R.
Description
Flags
Limitations
Description
Flags
Data Conversion Section 5-15