2 Instructions
2-196 CP1E CPU Unit Instructions Reference Manual(W483)
DMPX
Applicable Program Areas
Operands

16-to-4 bit conversion

C: Control Word
Instruction Mnemonic Variations Function
code Function
DATA ENCODER DMPX @DMPX 077
FInds the location of the first or last ON bit within
the source word with 16-to-4 conversion (or 256-
to-8 conversion), and writes that value to the spec-
ified digit (or byte) in the result word.
Symbol
DMPX
Area Step program areas Subroutines Interrupt tasks
Usage OK OK OK
Operand Description Data type Size
S First source word UINT Variable
R Result word UINT 1
C Control word UINT 1
S: First Source Word

S: 1st digit of digits to be encoded

S+1: 2nd digit of digits to be encoded

S+2: 3rd digit of digits to be encoded

S+3: 4th digit of digits to be encoded

R: Result Word

Note The source words must be in the same data
area.
DMPX(077)
S
R
C
S: First source word
R: Result word
C: Control word
R Digit 3 Digit 2
811
1215
Digit 1 Digit 0
03
47
The results of encoding of S to S+3 are
stored from the starting digit going left
(returns to digit 0 after digit 3).
C0
8
111215
ln
03
47
Conversion process
0: 16-to-4 bits (word to digit)
Bit to encode
0: Leftmost bit (highest bit address)
1: Rightmost bit (lowest bit address)
Number of digits/bytes to be converted
0 to 3 (1 to 4 digits)
Specifies the first digit/byte to receive converted data.
0 to 3 (digit 0 to 3)