Advanced Function Instruction
7 -3 8
FUN 59
P
→
7SG
7-SEGMENT CONVERSION
FUN 59
P
→
7SG
〈
Example 1
〉
When M1 OFF
→
ON, convert hexadecimal to 7-Segment
M1
EN
S :
N : 0
R0
59P. 7SG
D : R100
ERR
˙
Figure left shown the conversion of first digit(nibble) of
R0 to 7-segment and store in low byte of R100, the
high byte of R100 remain unchanged.
Original
R100
=
0000H
R0
=
0001H
Î
R100
=
0030H
(
1
)
〈
Example 2
〉
When M1 ON, convert the hexadecimal to 7-Segment
M1
EN S :
N : 1
R0
59. 7SG
D : R100
ERR
˙
Instruction at left will convert the first and the second
digit of R0 to 7-segment and store in R100.
˙
The low byte of R100 stores first digit.
˙
The high byte of R100 stores second digit.
R0
=
0056H
Î
R100
=
5B5FH
(
56
)
〈
Example 3
〉
When M1 ON, converting hexadecimal to 7-Segment
M1
EN S :
N :
R0
59. 7SG
D : R100
ERR
2
˙
Instruction at left will convert the first, second and third
digit of R0 to 7-segment and store in R100 and R101.
˙
The low byte of R100 stores first digit.
˙
The high byte of R100 stores second digit.
˙
The low byte of R101 stores third digit.
˙
The high byte of R10 remain unchanged.
Original
R101=0000H
R0=0A48H
Î
R100=337FH
(
48
)
R101=0077H
(
A
)
〈
Example 4
〉
When M1 ON, convert hexadecimal to 7-Segment
M1
EN S :
N : 3
R0
59. 7SG
D : R100
ERR
˙
Instruction at left will convert 1~4 digit of R0 to
7-segment and store in R100 and R101.
˙
The low byte of R100 stores first digit.
˙
The high byte of R100 stores second digit.
˙
The low byte of R101 stores third digit.
˙
The high byte of R10 stores 4
th
digit.
R0=2790H
Î
R100=7B7EH
(
90
)
R101=6D72H
(
27
)