单片机汇编吧 关注:121贴子:364
  • 0回复贴,共1

爱心设计程序

只看楼主收藏回复


ORG 0000H
AJMP MAIN
ORG 0100H
MAIN:
MOV P1,#0FFH //////显示第一个’L‘
MOV A,#00H
ACALL CHA
MOV P2,A
CLR P1.0
ACALL DELAY
SETB P1.0
///////显示第二个’O‘
MOV A,#01H
ACALL CHA
MOV P2,A
CLR P1.1
ACALL DELAY
SETB P1.1
///////显示第三个’V‘
MOV A,#02H
ACALL CHA
MOV P2,A
CLR P1.2
ACALL DELAY
SETB P1.2
//////显示第四个’E‘
MOV A,#03H
ACALL CHA
MOV P2,A
CLR P1.3
ACALL DELAY
SETB P1.3
//////显示第五个’2‘
MOV A,#04H
ACALL CHA
MOV P2,A
CLR P1.4
ACALL DELAY
SETB P1.4
///////显示第六个’0‘
MOV A,#05H
ACALL CHA
MOV P2,A
CLR P1.5
ACALL DELAY
SETB P1.5
////////显示第七个’1‘
MOV A,#06H
ACALL CHA
MOV P2,A
CLR P1.6
ACALL DELAY
SETB P1.6
////////显示第八个’4‘
MOV A,#07H
ACALL CHA
MOV P2,A
CLR P1.7
ACALL DELAY
SETB P1.7
ACALL DELAY
LJMP MAIN
DELAY:
MOV R6,#20
DJNZ R6,$
RET
CHA:
MOV DPTR,#TAB
MOVC A,@A+DPTR
RET
TAB:
DB 38H,3FH,3EH,79H,5BH,3FH,06H,66H
END


IP属地:江西1楼2013-12-15 20:32回复