您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 项目/工程管理 > 函数信号发生器汇编程序
ORG0000HAJMMAINORG000BHLJMPTC0ORG0030HMAIN:MOVDPTR,#7FFFH指向DAC0832(1)MOVA,70HMOVX@DPTR,ADAC0832(1)输出MOVDPTR,#7F00H指向8155命令字端口地址MOVA,#06H设置A口为输入,B口、C口为输出MOVX@DPTR,A送命令字MOVDPTR,#7F01H指向A口地址MOVXA,@DPTR读入A口的开关数据JNBACC.3,K10H判断是否“4”号键,若是则转输出10Hz信号JNBACC.4,K100H判断是否“5”号键,若是则转输出100Hz信号JNBACC.5,K500H判断是否“6”号键,若是则转输出500Hz信号AJMPMAINLED1:MOVR3,#06H设置6个LED显示MOVR2,#01H选通第一位LED数据MOVR1,#30H送显示缓冲区首址GN1:MOVDPTR,#7F03H指向C口地址MOVA,R2位选通数据送AMOVX@DPTR,A位选通数据送C口RLA选通下一位MOVR2,A位选通数据送R2中保存MOVA,@R1取键值MOVDPTR,#TAB送LED显示软件译码表首址MOVCA,@A+DPTR查表求出键值显示的段码MOVDPTR,#7F02H指向B口地址MOV@DPTR,A段码送显示LCALLLOOP1调延时子程序INCR1指向下一位显示缓冲区地址DJNZR3,GN1循环显示6个LEDRETLOOP1:MOVR4,#08H延时子程序LOOP:MOVR5,#0A0HDJNZR5'$DJNZR4,LOOPRETK10H:MOV30H,#00H显示10HzMOV31H,#00HMOV32H,#00HMOV33H,#00HMOV34H,#01HMOV35H,#00HLCALLLED1调显示子程序MOVTMOD,#00HMOVTL0,#15HMOVTH0,#9EHAJMPPDK100H:MOV30H,#00H显示100HzMOV31H,#00HMOV32H,#00HMOV33H,#01HMOV34H,#00HMOV35H,#00HLCALLLED1调显示子程序MOVTMOD,#00HMOVTL0,#08HMOVTH0,#0F6HAJMPPDK500H:MOV30H,#00H显示500HzMOV31H,#00HMOV32H,#00HMOV33H,#05HMOV34H,#00HMOV35H,#00HLCALLLED1调显示子程序MOVTMOD,#00HMOVTL0,#01HMOVTH0,#0FEHAJMPPDPD:JNBACC.0,KE0判断是否“0”号键按下,若是则转方波输出JNBACC.1,KE1判断是否“1”号键按下,若是则转正弦方波输出JNBACC.2,KE2判断是否“2”号键按下,若是则转三角波输出JNBACC.3,KE3判断是否“3”号键按下,若是则转锯齿波输出LJMPPDKE0:MOVR7,#00HLCALLLED1调显示子程序MOVR6,#00HAJMPGNKE1:MOVR7,#02HLCALLLED1调显示子程序MOVR6,#00HAJMPGNKE2:MOVR7,#02HLCALLLED1调显示子程序MOVR6,#00HAJMPGNKE3:MOVR7,#02HLCALLLED1调显示子程序MOVR6,#00HGN:SETBTR0SETBET0SETBEALOP1:JNBACC.4,K10H判断是否“4”号键,若是则转输出10Hz信号JNBACC.5,K100H判断是否“5”号键,若是则转输出100Hz信号JNBACC.6,K500H判断是否“6”号键,若是则转输出500Hz信号JNBACC.7,K1K判断是否“7”号键,若是则转输出1KHz信号AJMPLOP1TC0:CJNER7,#00H,TC1发送方波程序MOVDPTR,#TAB1送方波数据表首址MOVA,R6发送数据寄存器MOVCA,@A+DPTRMOVDPTR,#0AFFFH指向DAC0832(2)MOVX@DPTR,ADAC0832(2)输出MOVA,R6INCAMOVR6,ACJNEA,#32,QL1MOVR6,#00HAJMPQL1TC1:CJNER7,#01H,TC2发送正弦波程序MOVDPTR,#TAB2送正弦波数据表首址MOVA,R6MOVCA,@A+DPTRMOVDPTR,#0AFFFH指向DAC0832(2)MOVX@DPTR,ADAC0832(2)输出MOVA,R6INCAMOVR6,ACJNEA,#32,QL1MOVR6,#00HAJMPQL1TC2:CJNER7,#02H,QL1发送三角波程序MOVDPTR,#TAB3送三角波数据表首址MOVA,R6MOVCA,@A+DPTRMOVDPTR,#0AFFFH指向DAC0832(2)MOVX@DPTR,ADAC0832(2)输出MOVA,R6INCAMOVR6,ACJNEA,#32,QL1MOVR6,#00HAJMPQL1TC3:CJNER7,#03H,QL1发送锯齿波程序MOVDPTR,#TAB4送锯齿波数据表首址MOVA,R6MOVCA,@A+DP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,00H,00H,00H,00H,00H,00HDB00H,00H,00H,00H,00H,00H,00H,00HDB00H,00H,00H,00H,00H,00H,00H,00HDB00H,00H,00H,00H,00H,00H,00H,00HDB00H,00H,00H,00H,00H,00H,00H,00HDB00H,00H,00H,00H,00H,00H,00H,00HDB00H,00H,00H,00H,00H,00H,00H,00HTAB2:DB80H,83H,86H,89H,8DH,90H,93H,96HDB99H,9CH,9FH,0A2H,0A5H,0A8H,0ABH,0AEHDB0B1H,0B4H,0B7H,0BAH,0BCH,0BFH,0C2H,0C5HDB0C7H,0CAH,0CCH,0CFH,0D1H,0D4H,0D6H,0D8HDB0DAH,0DDH,0DFH,0E1H,0E3H,0E5H,0E7H,0E9HDB0EAH,0ECH,0EEH,0EFH,0F1H,0F2H,0F4H,0F5HDB0F6H,0F7H,0F8H,0F9H,0FAH,0FBH,0FCH,0FDHDB0FDH,0FEH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFHDB0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FEH,0FDHDB0FDH,0FCH,0FBH,0FAH,0F9H,0F8H,0F7H,0F6HDB0F5H,0F4H,0F2H,0F1H,0EFH,0EEH,0ECH,0EAHDB0E9H,0E7H,0E5H,0E3H,0E1H,0DEH,0DDH,0DAHDB0D8H,0D6H,0D4H,0D1H,0CFH,0CCH,0CAH,0C7HDB0C5H,0C2H,0BFH,0BCH,0BAH,0B7H,0B4H,0B1HDB0AEH,0ABH,0A8H,0A5H,0A2H,9FH,9CH,99HDB96H,93H,90H,8DH,89H,86H,83H,80HDB80H,7CH,79H,78H,72H,6FH,6CH,69HDB66H,63H,60H,5DH,5AH,57H,55H,51HDB4EH,4CH,48H,45H,43H,40H,3DH,3AHDB38H,35H,33H,30H,2EH,2BH,29H,27HDB25H,22H,20H,1EH,1CH,1AH,18H,16HDB15H,13H,11H,10H,0EH,0DH,0BH,0AHDB09H,08H,07H,06H,05H,04H,03H,02HDB02H,01H,00H,00H,00H,00H,00H,00HDB00H,00H,00H,00H,00H,00H,01H,02HDB02H,03H,04H,05H,06H,07H,08H,09HDB0AH,0BH,0DH,0EH,10H,11H,13H,15HDB16H,18H,1AH,1CH,1EH,20H,22H,25HDB27H,29H,2BH,2EH,30H,33H,35H,38HDB3AH,3DH,40H,43H,45H,48H,4CH,4EHDB51H,55H,57H,5AH,5DH,60H,63H,66HDB69H,6CH,6FH,72H,76H,79H,7CH,80HTAB3:DB00H,02H,04H,06H,08H,0AH,0CH,0EHDB10H,12H,14H,16H,18H,1AH,1CH,1EHDB20H,22H,24H,26H,28H,2AH,2CH,2EHDB30H,32H,34H,36H,38H,3AH,3CH,3EHDB40H,42H,44H,46H,48H,4AH,4CH,4EHDB50H,52H,54H,56H,58H,5AH,5CH,5EHDB60H,62H,64H,66H,68H,6AH,6CH,6EHDB70H,72H,74H,76H,78H,7AH,7CH,7EHDB80H,82H,84H,86H,88H,8AH,8CH,8EHDB0A0H,0A2H,0A4H,0A6H,0A8H,0AAH,0ACH,0AEHDB0B0H,0B2H,0B4
本文标题:函数信号发生器汇编程序
链接地址:https://www.777doc.com/doc-5592226 .html