13.07.2015 Views

[Instruction] Contents

[Instruction] Contents

[Instruction] Contents

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Advanced Function <strong>Instruction</strong>FUN 59 P→7SG7-SEGMENT CONVERSIONFUN 59 P→7SG〈Example 1〉When M1 OFF→ON, convert hexadecimal to 7-SegmentM159P. 7SGEN S : R0ERR˙Figure left shown the conversion of first digit(nibble) ofR0 to 7-segment and store in low byte of R100, theN : 0high byte of R100 remain unchanged.D : R100Original R100=0000HR0=0001H R100=0030H(1)〈Example 2〉When M1 ON, convert the hexadecimal to 7-SegmentM159. 7SGEN S : R0ERR˙<strong>Instruction</strong> at left will convert the first and the seconddigit of R0 to 7-segment and store in R100.N : 1˙The low byte of R100 stores first digit.D : R100˙The high byte of R100 stores second digit.R0=0056H R100=5B5FH(56)〈Example 3〉When M1 ON, converting hexadecimal to 7-Segment˙<strong>Instruction</strong> at left will convert the first, second and thirddigit of R0 to 7-segment and store in R100 and R101.M159. 7SGEN S :N :R02D : R100ERR˙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=0000HR0=0A48H R100=337FH(48)R101=0077H(A)〈Example 4〉When M1 ON, convert hexadecimal to 7-SegmentM159. 7SGEN S : R0N : 3D : R100ERR˙<strong>Instruction</strong> at left will convert 1~4 digit of R0 to7-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)7-38

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!