P1M0 EQU 92H
P1M1 EQU 91H
P3M0 EQU 0B2H
P3M1 EQU 0B1H
P5 EQU 0C8H
P5M0 EQU 0CAH
P5M1 EQU 0C9H
PK1 EQU P5.4
PK2 EQU P3.5
PK3 EQU P3.7
PK4 EQU P3.3;PK1-4为位驱动
ORG 0000H
JMP STAR
ORG 0100H
STAR:
MOV P1M0,#0FFH//MOV P1M0,0FFH
MOV P1M1,#00H//MOV P1M1,00H
MOV P3M0,#00H//MOV P3M0,0A8H
MOV P3M1,#00H //MOV P3M1,00H
MOV P5M0,#00H//MOV P5M0,10H
MOV P5M1,#00H//MOV P5M1,00H
MAIN:
MOV P1,#04H
CLR PK1
CALL YS5
SETB PK1
MOV P1,#10H
CLR PK2
CALL YS5
SETB PK2
MOV P1,#40H
CLR PK3
CALL YS5
SETB PK3
MOV P1,#44H
CLR PK4
CALL YS5
SETB PK4
JMP MAIN
YS5:MOV R4,#05H
YD5:MOV R3,#05H
YD6:NOP
DJNZ R3,YD6
DJNZ R4,YD5
RET
END
//要注意汇编语言中立即数、直接地址、间接地址的定义及格式
|