单片机课程设计报告源程序

时间:2023-05-10 03:17:20 阅读: 最新文章 文档下载
说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

AJMP START

ORG 0600H

START:MOV TMOD,#51H

MOV TH0,#3CH

MOV TL0,#0B0H

MOV IE,#82H

MOV TH1,#00H

MOV TL1,#00H

SETB TR0

SETB TR1

LOOP:SJMP $

ORG 000BH

AJMP BTR0

ORG 0080H

BTR0:CLR TR1

CLR TR0

MOV A,TH1

CJNE A,#01H,NEXT1

SJMP NEXT2

NEXT1:JC BEGIN

JNC NEXT4

NEXT2:MOV A,TL1

CJNE A,#0F4H,NEXT3

SJMP NEXT4

NEXT3:JC BEGIN

JNC NEXT4

NEXT4:MOV A,#99H

MOV P1,A

MOV P2,A

LJMP LAST

BEGIN:MOV A, TL1

MOV B,#14H

MUL AB

MOV R2,B

MOV B,#10H

DIV AB

MOV R0,A

MOV R1,B

MOV A,TH1

MOV B,#14H

MUL AB

ADD A,R2

MOV B,#10H

DIV AB

MOV R2,B

MOV R7,A

MOV B,#06H

MUL AB

MOV B,#0AH

DIV AB

MOV 40H,A

MOV 41H,B

MOV B,#06H

MOV A,R0

MUL AB

MOV B,#0AH

DIV AB

MOV R3,A

MOV R4,B

MOV A,R2

MOV B,#06H

MUL AB

MOV B,#0AH

DIV AB

MOV R5,A

MOV R6,B

MOV A,R1

ADD A,R4

ADD A,R6

ADD A,41H

MOV B,#0AH

DIV AB

MOV R1,B

ADD A,R0

ADD A,R3

ADD A,R5

MOV R0,A

MOV A,R2

MOV B,#05H

MUL AB

ADD A,R0

MOV R0,A

MOV A,R7

MOV B,#09H

MUL AB

MOV B,#0AH

DIV AB

MOV 42H,A

MOV A,B

ADD A,R0

ADD A,40H

MOV B,#0AH

DIV AB

MOV R0,B

MOV R3,A

MOV A,R2

MOV B,#02H

MUL AB

ADD A,R3

ADD A,42H

MOV B,#0AH

DIV AB

MOV R4,A

MOV R5,B

MOV A,R7

MOV B,#04H

MUL AB

ADD A,R4

MOV B,#01H

MUL AB

ADD A,R5

MOV P1,A

MOV A,R0

MOV B,#10H

MUL AB

ADD A,R1

MOV P2,A

LAST:MOV TH0,#3CH

MOV TL0,#0B0H

MOV TH1,#00H

MOV TL1,#00H

SETB TR1

SETB TR0

RETI

END

本文来源:https://www.wddqw.com/doc/36fedf53f5335a8103d22002.html