Binary Subtract -- Sbb - Omron CPM1 Programming Manual

Hide thumbs Also See for CPM1:
Table of Contents

Advertisement

Example
TR 0
00000
25504
25504
7-21-2 BINARY SUBTRACT - - SBB(51)
Limitations
The following example shows a four-digit addition with CY used to place either
#0000 or #0001 into R+1 to ensure that any carry is preserved.
In the case below, A6E2 + 80C5 = 127A7. The result is a 5-digit number, so CY
(SR 25504) = 1, and the content of R + 1 becomes #0001.
Note For signed binary calculations, the status of the UF and OF flags indicate wheth-
er the result has exceeded the signed binary data range (--32,768 (8000) to
+32,767 (7FFF)).
Ladder Symbols
SBB(51)
Mi
Su
R
DM 6144 to DM 6655 cannot be used for R.
Address Instruction
00000
CLC(41)
00001
00002
ADB(50)
00003
200
DM 0100
HR 10
= R
00004
MOV(21)
00005
#0000
HR 11
= R+1
00006
MOV(21)
00007
#0001
00008
HR 11
= R+1
Au: IR 200
A
6
+
Ad: DM 0100
8
0
R+1: HR 11
R: HR 10
0
0
0
1
2
7
IR, SR, AR, DM, HR, TC, LR, #
@SBB(51)
Mi
IR, SR, AR, DM, HR, TC, LR, #
Su
R
Section
Operands
LD
00000
OUT
TR
CLC(41)
ADB(50)
DM
HR
AND NOT
25504
MOV(21)
#
HR
LD
TR
AND
25504
MOV(21)
#
00001
HR
E
2
C
5
A
7
Operand Data Areas
Mi: Minuend word (binary)
Su: Subtrahend word (binary)
R: Result word
IR, SR, AR, DM, HR, LR
7-21
0
200
0100
10
0000
11
0
11

Advertisement

Table of Contents
loading

This manual is also suitable for:

Srm-v2Cpm1aCpm2aSrm1Cpm2c

Table of Contents