08.01.2013 Views

MCS-51 单片机设计应用程序实例 - Read

MCS-51 单片机设计应用程序实例 - Read

MCS-51 单片机设计应用程序实例 - Read

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.

AJMP DISP1<br />

CONT: ADD A,R5<br />

;<br />

;<br />

MOV B,A<br />

AJMP LOOP<br />

DISPLAY: MOV A,#0FFH<br />

MOV P0,A<br />

MOV P2,A<br />

MOV R6,#0FEH<br />

MOV R0,B<br />

MOV R7,#08H<br />

DISLOOP: MOV A,@R0<br />

;<br />

MOV P0,A<br />

MOV P2,R6<br />

LCALL DL1MS<br />

INC R0<br />

MOV A,R6<br />

RL A<br />

MOV R6,A<br />

DJNZ R7,DISLOOP<br />

RET<br />

DISP2: LCALL DISPP<br />

;<br />

LCALL MOVH<br />

LCALL MOVH1<br />

AJMP DISP2<br />

DISPP: MOV B,#50H<br />

;<br />

MOV R4,#24H<br />

LCALL DISPLAY<br />

DJNZ R4,DISPP<br />

RET<br />

MOVH: MOV R1,#20H<br />

MOV R0,#50H<br />

MOV R2,#08H<br />

MOV1: MOV A,@R0<br />

CLR C<br />

RLC A<br />

MOV @R0,A<br />

MOV A,@R1<br />

RRC A<br />

MOV @R1,A<br />

<strong>MCS</strong>-<strong>51</strong> 系 列 单 片 机 设 计 实 例<br />

PDF created with FinePrint pdfFactory trial version http://www.fineprint.com<br />

16

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

Saved successfully!

Ooh no, something went wrong!