310
Conversion Instructions Section 5-20
The result can be calculated by first converting all BCD values to signed
binary and then using the following formula.
Flags ER: Indirectly addressed EM/DM word is non-existent.
(Content of *EM/*DM word is not BCD, or the EM/DM area boundary
has been exceeded.)
The content of S is not BCD.
CY: CY is not changed by SCL3(––). (CY shows the sign of S before exe-
cution.)
EQ: ON when the result, R, is 0000.
Example The status of 00101 determines the sign of the BCD source word in the follow-
ing example. If 00101 is ON, then the source word is negative. When 00100 is
turned ON, the BCD source data in LR 02 is converted to signed binary
according to the parameters in DM 0000 to DM 0004. The result is then writ-
ten to DM 0100. (In the second conversion, the signed binary equivalent of
–1035 is less than the lower limit specified in DM 0004, so the lower limit is
written to DM 0100.)
R = × S +P1
∆X
∆Y
CLC(41)
STC(40)
00100
Address Instruction Operands
00000 LD 25313
00001 CLC(41)
00002 LD 00101
00101 STC(40)
00004 LD 00100
00005 SCL3(−−)
LR 02
DM 0000
DM
0100
25313
(Alwa
ys ON)
00101
@SCL3(−−)
DM 0000
LR 02
DM 0100
DM 0000 0005
DM 0001 0003
DM 0002 0006
DM 0003 07FF
DM 0004 F800
LR 02 0100
DM 0100 00CD
0005
3
6
CY=0
BCD
Signed hex.
LR 02 1035
DM 0100 F800
CY=1