158
4
4 Instructions4.5.1 Data Conversion
◆
Function
1) 16-bit instruction
●
Every digit of the 16-bit BIN number in [S] is ASCII encoded (30H to 39H) in decimal format. The result
is stored in elements from head address [D].
ASCII ten-thousands place ASCII sign bit
ASCII hundreds place
ASCII thousands place
ASCII ones place ASCII tens place
[D+0]
+1
+2
b15------------------b8---b7---------------------b0
16-bit decimal integer
[S]
000H or original data
M8163 =OFF:0000H
M8163=ON:
Unchanged
●
The value in [S] ranges from –32,768 to +32,767.
●
The operation result is as follows:
• When the 16-bit number is positive, the sign bit is set to 20H (space). When it is negative, the sign bit is set to 2DH
(minus sign).
• When 0 exists on the left of valid digits, the sign bit is set to 20H (space).
• The value in [D+3] is determined based on whether M8163 is set to ON or OFF.
2) 32-bit instruction
●
Every digit of the 32-bit BIN number in [S+1, S] is ASCII encoded (30H to 39H) in decimal format. The
result is stored in elements from head address [D].
ASCII billions place
ASCII sign bit
ASCII ten-millions place
ASCII hundred-millions place
ASCII hundred-thousands place
ASCII millions place
[D+0]
+1
+2
b15------------------b8---b7---------------------b0
Higher
16 bits
ASCII thousands place
ASCII ten-thousands place
ASCII ones place
ASCII hundreds place
00H or 20H
ASCII ones place
+3
+4
[S+1]
M8163 =OFF:00H
M8163=ON:20H
[S+0]
Lower
16 bits
●
The value in [S+1, S] ranges from –2,147,483,648 to +2,147,483,647.
●
The operation result is as follows:
• When the 16-bit number is positive, the sign bit is set to 20H (space). When it is negative, the sign bit is set to 2DH
(minus sign).
• When 0 exists on the left of valid digits, the sign bit is set to 20H (space).
• The higher bytes in [D+5] are determined based on whether M8163 is set to ON or OFF.