Chapter 6: Instructions
71
Arithmetic Instructions
Mnemonic
Command
Word
Double Word
Description
ADD
(DADD)
Decimal addition
ADD
D =
S1 =
S2 =
DADD
D =
S1 =
S2 =
D = S1 + S2
(Decimal operation)
SUB
(DSUB)
Decimal subtraction
SUB
D =
S1 =
S2 =
DSUB
D =
S1 =
S2 =
D = S1 - S2
(Decimal operation)
MUL
(DMUL)
Decimal
multiplication
MUL
D =
S1 =
S2 =
DMUL
D =
S1 =
S2 =
D = S1
×
S2
(Decimal operation)
DIV
(DDIV)
Decimal division
DIV
D =
S1 =
S2 =
DDIV
D =
S1 =
S2 =
D = S1/S2
(Decimal operation)
ADDB
(DADDB)
BCD addition
ADDB
D =
S1 =
S2 =
DADDB
D =
S1 =
S2 =
D = S1 + S2
(BCD operation)
SUBB
(DSUBB)
BCD subtraction
SUBB
D =
S1 =
S2 =
DSUBB
D =
S1 =
S2 =
D = S1 - S2
(BCD operation)
MULB
(DMULB)
BCD multiplication
MULB
D =
S1 =
S2 =
DMULB
D =
S1 =
S2 =
D = S1
×
S2
(BCD operation)
DIVB
(DDIVB)
BCD division
DIVB
D =
S1 =
S2 =
DDIVB
D =
S1 =
S2 =
D = S1/S2
(BCD operation)
ADC
(DADC)
Decimal addition
w/carry
ADC
D =
S1 =
S2 =
DADC
D =
S1 =
S2 =
D = S1 + S2 + CY
(Decimal operation, include carry)
SBC
(DSBC)
Decimal subtraction
w/carry
SBC
D =
S1 =
S2 =
DSBC
D =
S1 =
S2 =
D = S1 - S2 - CY
(Decimal operation, include carry)
ADCB
(DADCB)
BCD addition
w/carry
ADCB
D =
S1 =
S2 =
DADCB
D =
S1 =
S2 =
D = S1 + S2 + CY
(BCD operation, include carry)
SBCB
(DSBCB)
BCD subtraction
w/carry
SBCB
D =
S1 =
S2 =
DSBCB
D =
S1 =
S2 =
D = S1 - S2 - CY
(BCD operation, include carry)
ABS
(DABS)
Absolute value
ABS
D =
DABS
D =
D = |D|
(Absolute value operation)
NEG
(DNEG)
Negative
(2’s complement)
NEG
D =
DNEG
D =
Store the 2’s complement of D in D
(1’s comp 1).
NOT
(DNOT)
NOT
(1’s complement)
NOT
D =
DNOT
D =
Store the 1’s complement of D in D.
Summary of Contents for D320 PLC
Page 1: ...D320 PLC User s Manual...
Page 18: ...6 D320 PLC User s Manual...
Page 28: ...16 D320 PLC User s Manual...
Page 34: ...22 D320 PLC User s Manual...
Page 78: ...66 D320 PLC User s Manual...
Page 176: ...164 D320 PLC User s Manual...
Page 210: ...198 D320 PLC User s Manual...
Page 258: ...246 D320 PLC User s Manual...