3. Instructions
804
CS/CJ/NSJ Series Instructions Reference Manual (W474)
SDEC
Applicable Program Areas
Operands
Di: Digit designator
z Operand Specifications
Flags
Instruction Mnemonic Variations
Function
code
Function
7-SEGMENT DECODER SDEC @SDEC 078
Converts the hexadecimal contents of the desig-
nated digit(s) into 8-bit, 7-segment display code
and places it into the upper or lower 8-bits of the
specified destination words.
Symbol
SDEC
Area
Function block
definitions
Block program areas Step program areas Subroutines Interrupt tasks
SFC action or
transition programs
Usage OK OK OK OK OK OK
Operand Description Data type Size
S Source word UINT 1
Di Digit designator UINT 1
D First destination word UINT Variable
Area
Word addresses
Indirect DM/EM
addresses
Con-
stants
Registers Flags
Pulse
bits
TR
bits
CIO WR HR AR T C DM EM
@DM
@EM
*DM
*EM
DR IR
Indirect
using IR
TK CF
S
OK OK OK OK OK OK OK OK OK OK
---
OK
--- OK --- --- --- ---Di OK
D --- ---
Name Label Operation
Error Flag ER • ON if settings in Di are not within the specified ranges.
• OFF in all other cases.
S: Source word
Di: Digit designator
D: First destination word
SDEC(078)
S
Di
D
0 1/0 m n
15 12 11 8 7 4 3 0
Di
First digit of S to convert (0 to 3)
0: Digit 0 (bits 0 to 3 of S)
1: Digit 1 (bits 4 to 7 of S)
2: Digit 2 (bits 8 to 11 of S)
3: Digit 3 (bits 12 to 15 of S)
Number of digits to convert
0 to 3: 1 to 4 digits
First half of D to receive converted data
0: Rightmost 8 bits (1st half)
1: Leftmost 8 bits (2nd half)
Not used; set to 0.