资源描述:
《51单片机蜂鸣器奏乐实验汇编代码》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、ORG0000HLJMPSTARTORG000BHINC20H;中断服务,中断计数器加1MOVTH0,#0D8HMOVTL0,#0EFH;12M晶振,形成10毫秒中断RETISTART:MOVSP,#50HMOVTH0,#0D8HMOVTL0,#0EFHMOVTMOD,#01HMOVIE,#82HMUSIC0:NOPMOVDPTR,#DAT;表头地址送DPTRMOV20H,#00H;中断计数器清0MUSIC1:NOPCLRAMOVCA,@A+DPTR;查表取代码JZEND0;是00H,则结束CJNEA,#0FFH,MUSIC5LJMPMUSIC3MUSIC5:NOPMOV
2、R6,AINCDPTRMOVA,#0MOVCA,@A+DPTRMOVR7,ASETBTR0MUSIC2:NOPCPLP3.2MOVA,R6MOVR3,ALCALLDELMOVA,R7CJNEA,20H,MUSIC2MOV20H,#00HINCDPTRLJMPMUSIC1MUSIC3:NOPCLRTR0MOVR2,#0DHMUSIC4:NOPMOVR2,#0FFHLCALLDELDJNZR2,MUSIC4INCDPTRLJMPMUSIC1END0:NOPMOVR2,#0FFHMUSIC6:MOVR3,#00HLJMPMUSIC0DEL:NOPDEL3:MOVR4,#02HD
3、EL4:NOPDJNZR4,DEL4NOPDJNZR3,DEL3RETNOPDAT:DB18H,30H,1CH,10HDB20H,40H,1CH,10HDB18H,10H,20H,10HDB1CH,10H,18H,40HDB1CH,20H,20H,20HDB1CH,20H,18H,20HDB20H,80H,0FFH,20HDB30H,1CH,10H,18HDB20H,15H,20H,1CHDB20H,20H,20H,26HDB40H,20H,20H,2BHDB20H,26H,20H,20HDB20H,30H,80H,0FFHDB20H,20H,1CH,10HDB18H,1
4、0H,20H,20HDB26H,20H,2BH,20HDB30H,20H,2BH,40HDB20H,20H,1CH,10HDB18H,10H,20H,20HDB26H,20H,2BH,20HDB30H,20H,2BH,40HDB20H,30H,1CH,10HDB18H,20H,15H,20HDB1CH,20H,20H,20HDB26H,40H,20H,20HDB2BH,20H,26H,20HDB20H,20H,30H,80HDB20H,30H,1CH,10HDB20H,10H,1CH,10HDB20H,20H,26H,20HDB2BH,20H,30H,20HDB2BH,4
5、0H,20H,15HDB1FH,05H,20H,10HDB1CH,10H,20H,20HDB26H,20H,2BH,20HDB30H,20H,2BH,40HDB20H,30H,1CH,10HDB18H,20H,15H,20HDB1CH,20H,20H,20HDB26H,40H,20H,20HDB2BH,20H,26H,20HDB20H,20H,30H,30HDB20H,30H,1CH,10HDB18H,40H,1CH,20HDB20H,20H,26H,40HDB13H,60H,18H,20HDB15H,40H,13H,40HDB18H,80H,00HEND