256-to-8 bit conversion
S: First Source Word
S+15 to S: 1st digit of digits to be encoded
S+31 to S+16: 2nd digit of digits to be encoded
C: Control word
15
12
11
8
C
1
Bit to encode
0: Leftmost bit (highest bit address)
1: Rightmost bit (lowest bit address)
Conversion process
1: 256-to-8 bits (16-word range to byte)
Operand Specifications
Word addresses
Area
CIO
WR
HR
S
R
OK
OK
OK
C
Flags
Name
Error Flag
Function
DMPX(077) can perform 16-to-4 bit or 256-to-8 bit conversions. Set the leftmost digit of C to 0 to specify
16-to-4 bit conversion and set it to 1 to specify 256-to-8 bit conversion.
16-to-4 bit Conversion
When the fourth (leftmost) digit of C is 0, DMPX(077) finds the locations of the leftmost or rightmost ON
bits in up to 4 source words and writes these locations to R beginning with the specified digit.
FInds leftmost bit
(Highest bit address)
16-to-4 bit decoding
(Location of leftmost bit (m)
is written to R.)
R
CS/CJ/NSJ Series Instructions Reference Manual (W474)
7
4
3
0
l
n
Specifies the first digit/byte to receive converted data.
0 or 1 (byte 0 or 1)
Number of digits/bytes to be converted
0 or 1 (1 or 2 bytes)
Indirect DM/EM
@DM
AR
T
C
DM
EM
@EM
OK
OK
OK
OK
OK
OK
Label
ER
• ON if any of the source words contains 0000 hex (i.e., no bit to encode).
• ON if C is not within the specified ranges.
• OFF in all other cases.
C
m
Leftmost bit
n=2 (Start with digit 2.)
R: Result Word
15
R
Digit 1
The results of encoding of S to S+15, S+16 to
S+31 are stored from the starting digit going
left (returns to digit 0 after digit 1).
Note The source words must be in the same
data area.
Registers
addresses
Con-
stants
*DM
DR
*EM
---
---
OK
---
OK
OK
OK
Operation
l=1 (Convert
2 words.)
3. Instructions
8
7
0
Digit 0
Flags
Pulse
bits
Indirect
IR
TK
CF
using IR
---
OK
---
---
---
3
TR
bits
---
389
Need help?
Do you have a question about the CJ - INSTRUCTIONS REFERENCE MANUAL 07-2009 and is the answer not in the manual?