Omron CPM1 - PROGRAMING MANUAL 02-2001 Programming Manual page 483

Hide thumbs Also See for CPM1 - PROGRAMING MANUAL 02-2001:
Table of Contents

Advertisement

BCD Calculation Instructions
Example
TR 0
00003
Address
00000
00001
00002
00003
00004
00005
The following example works much like that for single-word subtraction. In this
example, however, BSET(71) is required to clear the content of DM 0000 and
DM 0001 so that a negative result can be subtracted from 0 (inputting an 8-digit
constant is not possible).
25504
25504
HR 0100
Instruction
Operands
LD
00003
OUT
TR
CLC(41)
@SUBL(55)
HR
220
DM
0100
AND
25504
@BSET(71)
#
0000
DM
0000
DM
0001
CLC(41)
@SUBL(55)
HR 00
DM 0100
@BSET(71)
#0000
DM 0000
DM 0001
CLC(41)
@SUBL(55)
DM 0000
DM 0100
DM 0100
Turned ON to indicate
negative result.
Address
Instruction
00006
CLC(41)
0
00007
@SUBL(55)
00
00008
LD
00009
LD
00010
OR
00011
AND LD
00012
OUT
Section
First
subtraction
220
Second
subtraction
HR 0100
Operands
DM
0000
DM
0100
DM
0100
TR
0
25504
HR
0100
HR
0100
7-21
465

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents