2 Instructions
2-354
CP1E CPU Unit Instructions Reference Manual(W483)
SDEC
Applicable Program Areas
Operands
Di: Digit designator
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 Step program areas Subroutines Interrupt tasks
Usage 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 addresses
Constants CF Pulse bits TR bits
CIO WR HR AR T C DM @DM *DM
S
OK OK OK OK OK OK OK OK OK
---
--- --- ---Di OK
D ---
Name Label Operation
Error Flag P_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.