155
4
4 Instructions 4.5.1 Data Conversion
◆
Function
Decimal oating-point numbers are converted to binary equivalents.
Example:
〔DEBIN D10 D2〕
X2
DS
〔MOVP K3142 D10〕
〔MOVP K-3 D11〕
The decimal oating-point number 3.142 (stored in D11 and D10) is converted to a binary equivalent. The
result is stored in (D3, D2).
DABIN: Conversion from decimal ASCII format to BIN format
◆
Overview
The DABIN instruction converts ASCII-encoded decimal numbers (30H to 39H) to BIN numbers.
DABIN S D
Conversion from
decimal ASCII format
to BIN format
Applicable model:
H3U
S
Input
value
Start number of elements that store the ASCII-encoded
decimal number to be converted to a BIN number
16-bit instruction
(5 steps)
DABIN: Continuous
execution
DABINP: Pulse
execution
32-bit instruction
(9 steps)
DDABIN:
Continuous
execution
DDABINP: Pulse
execution
D
Output
value
Number of the element that stores the conversion result
◆
Operands
Operand
Bit Element Word Element
System·User System·User Bit Designation Indexed Address Constant
Real
Number
S X Y M T C S SM D R T C SD KnX KnY KnM KnS KnSM
V,Z
Modication K H E
D X Y M T C S SM D R T C SD KnX KnY KnM KnS KnSM
V,Z
Modication K H E
Note: The elements in gray background are supported.
◆
Function
1) 16-bit instruction
●
The ASCII-encoded decimal number (30H to 39H) stored in [S] to [S+2] is converted to a 16-bit BIN
number. The result is stored in [D].
ASCII ten-
thousands place
ASCII sign bit
ASCII hundreds
place
ASCII thousands
place
ASCII ones place ASCII tens place
S+0
+1
+2
b15------------------b8---b7---------------------b0
16-bit data
[D]