單片機(jī)學(xué)習(xí)知識(shí)點(diǎn)全攻略(完結(jié)篇)(三)
MOV 20H,#00H ;中斷計(jì)數(shù)器清0
MOV B,#00H ;表序號(hào)清0
MUSIC1:
NOP
CLR A
MOVC A,@A+DPTR ;查表取代碼
JZ END0 ;是00H,則結(jié)束
CJNE A,#0FFH,MUSIC5
LJMP MUSIC3
MUSIC5:
NOP
MOV R6,A
INC DPTR
MOV A,B
MOVC A,@A+DPTR ;取節(jié)拍代碼送R7
MOV R7,A
SETB TR0 ;啟動(dòng)計(jì)數(shù)
MUSIC2:
NOP
CPL P1.0
MOV A,R6
MOV R3,A
LCALL DEL
評(píng)論