238
4
4 Instructions4.6.4 Matrix Rotation and Shift
All characters
S1
Characters in
the fractional
part
S1+1
S2
.
Sign
D
D+1
D+2
b7-----b0
D+3
b15-----b8
D+4
0000H
Automatically stored at the end of the string
5
S1
1
S1+1
-123
S2
.
31H(1)
2EH(.)
00H
D
D+1
D+2
b7---b0
2DH(-)
32H(2)
33H(3)
b15--b8
Automatically stored at the end of the string
3
12
16-bit data (BIN)
ASCII code of the (total character
count minus 1)th character
ASCII code of the (total character
count minus 3)th character
ASCII code of the (total character
count minus 5)th character
ASCII code of the (total character
count minus 7)th character
ASCII code of the sign
ASCII code of the (total character
count minus 2)th character
ASCII code of the (total character
count minus 4)th character
ASCII code of the (total character
count minus 6)th character
①
The value in [S1] ranges from 2 to 8.
②
The value in [S1+1] ranges from 0 to 5. The value in [S1+1] must be less than or equal to the value in [S1]
minus 3.
③
The 16-bit BIN number ranges from –32,768 to +32,767. The string after conversion is stored in
elements from head address [D].
• When the 16-bit BIN number in [S2] is positive, the sign is encoded into 20H (space); when it is
negative, the sign is encoded into 2DH (minus sign).
• When a number other than 0 is set in [S1+1], a decimal point (2EH) is inserted at the immediate
position prior to a number of characters indicated by [S1+1].
• No decimal point is inserted when the value in [S1+1] is 0.
5
Total number
of characters
2
Number of characters
in the fractional part
16-bit BIN data
21.54
Number of characters
in the fractional part
Added automatically
2154
• If the value in [S1+1] is greater than the number of characters contained in the 16-bit BIN number in [S2],
the system aligns characters to the right and then adds 0s (30H) on the left.
Total number
of characters
Number of characters
in the fractional part
16-bit BIN data
Added automatically
6
3
12
0.012
• With the decimal point and sign excluded, if the total number of characters indicated by [S1] is greater
than the number of characters contained in the 16-bit BIN number in [S2], spaces (20H) are inserted
between the sign and the value.
• An error will occur when the number of characters contained in the 16-bit BIN number in [S2] is greater.