基于单片机设计的简易电子琴外文翻译
答案:2 悬赏:0 手机版
解决时间 2021-04-14 17:09
- 提问者网友:原来太熟悉了会陌生
- 2021-04-14 03:32
基于单片机设计的简易电子琴外文翻译
最佳答案
- 五星知识达人网友:逐風
- 2021-04-14 04:39
于单片机设计的简易电子琴
BIU
BIU
全部回答
- 1楼网友:从此江山别
- 2021-04-14 06:01
keybuf equ 30h sth0 equ 31h stl0 equ 32h temp equ 33h org 00h ljmp start org 0bh ljmp int_t0 start: mov tmod,#01h setb et0 setb ea wait: mov p2,#0ffh clr p2.4 mov a,p2 anl a,#0fh xrl a,#0fh jz nokey1 lcall dely10ms mov a,p2 anl a,#0fh xrl a,#0fh jz nokey1 mov a,p2 anl a,#0fh cjne a,#0eh,nk1 mov keybuf,#0 ljmp dk1 nk1: cjne a,#0dh,nk2 mov keybuf,#1 ljmp dk1 nk2: cjne a,#0bh,nk3 mov keybuf,#2 ljmp dk1 nk3: cjne a,#07h,nk4 mov keybuf,#3 ljmp dk1 nk4: nop dk1: mov a,keybuf mov dptr,#table movc a,@a dptr mov p0,a mov a,keybuf mov b,#2 mul ab mov temp,a mov dptr,#table1 movc a,@a dptr mov sth0,a mov th0,a inc temp mov a,temp movc a,@a dptr mov stl0,a mov tl0,a setb tr0 dk1a: mov a,p2 anl a,#0fh xrl a,#0fh jnz dk1a clr tr0 nokey1: mov p2,#0ffh clr p2.5 mov a,p2 anl a,#0fh xrl a,#0fh jz nokey2 lcall dely10ms mov a,p2 anl a,#0fh xrl a,#0fh jz nokey2 mov a,p2 anl a,#0fh cjne a,#0eh,nk5 mov keybuf,#4 ljmp dk2 nk5: cjne a,#0dh,nk6 mov keybuf,#5 ljmp dk2 nk6: cjne a,#0bh,nk7 mov keybuf,#6 ljmp dk2 nk7: cjne a,#07h,nk8 mov keybuf,#7 ljmp dk2 nk8: nop dk2: mov a,keybuf mov dptr,#table movc a,@a dptr mov p0,a mov a,keybuf mov b,#2 mul ab mov temp,a mov dptr,#table1 movc a,@a dptr mov sth0,a mov th0,a inc temp mov a,temp movc a,@a dptr mov stl0,a mov tl0,a setb tr0 dk2a: mov a,p2 anl a,#0fh xrl a,#0fh jnz dk2a clr tr0 nokey2: mov p2,#0ffh clr p2.6 mov a,p2 anl a,#0fh xrl a,#0fh jz nokey3 lcall dely10ms mov a,p2 anl a,#0fh xrl a,#0fh jz nokey3 mov a,p2 anl a,#0fh cjne a,#0eh,nk9 mov keybuf,#8 ljmp dk3 nk9: cjne a,#0dh,nk10 mov keybuf,#9 ljmp dk3 nk10: cjne a,#0bh,nk11 mov keybuf,#10 ljmp dk3 nk11: cjne a,#07h,nk12 mov keybuf,#11 ljmp dk3 nk12: nop dk3: mov a,keybuf mov dptr,#table movc a,@a dptr mov p0,a mov a,keybuf mov b,#2 mul ab mov temp,a mov dptr,#table1 movc a,@a dptr mov sth0,a mov th0,a inc temp mov a,temp movc a,@a dptr mov stl0,a mov tl0,a setb tr0 dk3a: mov a,p2 anl a,#0fh xrl a,#0fh jnz dk3a clr tr0 nokey3: mov p2,#0ffh clr p2.7 mov a,p2 anl a,#0fh xrl a,#0fh jz nokey4 lcall dely10ms mov a,p2 anl a,#0fh xrl a,#0fh jz nokey4 mov a,p2 anl a,#0fh cjne a,#0eh,nk13 mov keybuf,#12 ljmp dk4 nk13: cjne a,#0dh,nk14 mov keybuf,#13 ljmp dk4 nk14: cjne a,#0bh,nk15 mov keybuf,#14 ljmp dk4 nk15: cjne a,#07h,nk16 mov keybuf,#15 ljmp dk4 nk16: nop dk4: mov a,keybuf mov dptr,#table movc a,@a dptr mov p0,a mov a,keybuf mov b,#2 mul ab mov temp,a mov dptr,#table1 movc a,@a dptr mov sth0,a mov th0,a inc temp mov a,temp movc a,@a dptr mov stl0,a mov tl0,a setb tr0 dk4a: mov a,p2 anl a,#0fh xrl a,#0fh jnz dk4a clr tr0 nokey4: ljmp wait dely10ms: mov r6,#10 d1: mov r7,#248 djnz r7,$ djnz r6,d1 ret int_t0: mov th0,sth0 mov tl0,stl0 cpl p1.0 reti table: db 3fh,06h,5bh,4fh,66h,6dh,7dh,07h db 7fh,6fh,77h,7ch,39h,5eh,79h,71h table1: dw 64021,64103,64260,64400 dw 64524,64580,64684,64777 dw 64820,64898,64968,65030 dw 65058,65110,65157,65178 end
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯