Chapter 6: Instructions
73
Word Conversion Instructions
Mnemonic
Command
Word
Double Word
Description
BCD
(DBCD)
Binary Coded
Decimal
BCD
D =
S =
DBCD
D =
S =
Convert binary number of S to BCD
and store in D.
S ...... 0 0 1 1 1 1 1 1 =63
D ...... 0 1 1 0 0 0 1 1 =$63
BIN
(DBIN)
Binary
BIN
D =
S =
DBIN
D =
S =
Convert BCD of S to binary number
and store in D.
S ...... 0 1 0 1 1 0 0 1 =$39
D ...... 0 0 1 0 0 1 1 1 =39
XCHG
(DXCHG)
Exchange
XCHG
D1 =
D2 =
DXCHG
D1 =
D2 =
Exchange D1 and D2.
D1 .. 0 1 0 1 D1 .. 0 0 1 1
D2 .. 0 0 1 1 D2 .. 0 1 0 1
SEG
Segment
SEG
D =
S =
Convert the low-order 4 bit value of S
to 7-segment display pattern and
store in D.
S ... 0 0 0 0 0 1 0 1
D ... 0 1 1 0 1 1 0 1
g f e d c b a
=5
a
f b
g
e c
d
ENCO
Encode
ENCO
D =
S =
Store the location of the highest set
bit in S in D.
15..8 7 6 5 4 3 2 1 0
S 0..0 0 1 1 1 0 0 0 0
D 0 0 0 0 0 1 1 1 6+1=7
invar
iable
DECO
Decode
DECO
D =
S =
Convert the low-order 4 bit value of S
to a power of 2 (2
s
) and store in D.
S ..... x x x x 0 1 0 1 =5
D 0..0 0 0 1 0 0 0 0 0
15..8 7 6 5 4 3 2 1 0
DIS
Dissemble
DIS
D =
Nd =
Sr =
Separate Sr into Nd+1 units of 4 bits
each, and store in the low 4 bits of
words starting at D. (N = 0-3)
Sr $ 7 4 1 1 1 0 0 1 0 1
D $0000 0 1 0 1
D+1 $0000 1 1 1 0
D+2 $0000 0 1 0 0 4
D+3 $0000 0 1 1 1 7
Nd+1
Nd=3
UNI
Unify
UNI
D =
Sr =
Nd =
Combine the low 4 bits of Nd+1
words starting at Sr, and store in D.
(Nd = 0-3)
Sr $ 0 1 0 1
S+1 $ 1 1 1 1
S+2 $ 1 0 1 0
S+3 $ 0 1 0 0
D $ 4 1 1 1 1 0 1 0 1
Nd+1
Nd=3
Содержание D320 PLC
Страница 1: ...D320 PLC User s Manual...
Страница 18: ...6 D320 PLC User s Manual...
Страница 28: ...16 D320 PLC User s Manual...
Страница 34: ...22 D320 PLC User s Manual...
Страница 78: ...66 D320 PLC User s Manual...
Страница 176: ...164 D320 PLC User s Manual...
Страница 210: ...198 D320 PLC User s Manual...
Страница 258: ...246 D320 PLC User s Manual...