本文包含原理图、PCB、源代码、封装库、中英文PDF等资源
您需要 登录 才可以下载或查看,没有账号?注册会员
×
老师给我看一下
org 0000h; 1
ajmp main; 2
org 030h; 3
main:
mov p2,#0ffh; 4
mov a,#0ffh; 5
mov p3,a; 6 置p3为输入状态
mov a,p3; 7
cpl a; 8
jz main; 9
JB acc.0,K0; 10
JB acc.1,k1; 11
JB acc.2,k2; 12
JMP MAIN; 13
s1:ljmp key1; 14
KEY1:mov p2,#03fh; 15
acall del1; 16
mov p2,#01fh; 17
acall del1; 18
mov p2,#00fh; 19
acall del1; 20
mov p2,#007h; 21
acall del1; 22
mov p2,#003h; 23
acall del1; 24
mov p2,#001h; 25
acall del1; 26
mov p2,#00h; 27
acall del1; 28
mov p3,#0ffh; 29
mov a,p3; 30
cpl a; 31
jz main1; 32
JB acc.1,K1; 33
JB acc.2,k2; 34
main1:mov r0,#0; 34
CJNE R0,#06h,KEY2; 36 6次循环后不停?
inc r0 37
jmp main; 38
k2:ljmp n1; 39 k2与key3接力点n
k0:ljmp s1 40 k0与key1接力点s
m1:ljmp key2
k1:ljmp key2 41
KEY2: mov p2,#03fh; 42
acall del1; 43
mov p2,#09fh; 44
mov p0,#0dfh; 45
acall del1; 46
mov p0,#0efh; 47
mov p2,#08fh; 48
acall del1; 49
mov p0,#0f7h; 50
mov p2,#087h; 51
acall del1; 52
mov p0,#0fbh; 53
mov p2,#083h; 54
acall del1; 55
mov p2,#081h; 56
mov p0,#0fdh; 57
acall del1; 58
mov p2,#080h; 59
mov p0,#0feh; 60
acall del1; 61
mov p3,#0ffh; 62
mov a,p3; 63
cpl a; 64
jz main2; 65
JB acc.2,K2; 66
JB acc.0,K0; 67
main2: CJNE R0,#06h,KEY2; 68
jmp main 69
n1:ljmp key3; 70
k1:ljmp m1 k1与key2接力点m,此处跳转出范围
KEY3: mov p2,#0ffh; 71
clr p2.6; 72
clr p3.7; 73
acall del1; 74
mov p1,#0efh; 75
clr p3.7; 76
mov p0,#0bfh; 77
acall del1 78
mov p1,#0e7h; 79
clr p3.7; 80
mov p0,#07fh; 81
acall del1 82
mov p0,#0ffh; 83
mov p1,#0c3h; 84
clr p3.7; 85
acall del1 86
mov p1,#0a1h; 87
clr p3.7; 88
acall del1 89
mov p1,#060h; 90
clr p3.7; 91
acall del1; 92
clr p2.0; 93
clr p3.7; 94
acall del1; 95
mov p3,#0ffh; 96
mov a,p3; 97
cpl a; 98
jz main3 99
main3: 100
JB acc.1,K1; 101 k1跳出范围
JB acc.0,K0; 102
CJNE R0,#6,KEY3; 103
jmp main; 104
del1: mov r7,#004h;
del2: mov r6,#008h;
del3: mov r5,#008h;
del4:djnz r5,del4;
djnz r6,del3
djnz r7,del2
ret;
end; 添加r |