您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 咨询培训 > 计算机硬件—汇编语言—电子跑表
F(2).txt;8255硬件连接,CS接300H;A口接LED段选,PA0~PA7接A~H;B口接LED位选,PB0~PB5接1~6;C口接5254,PC0接OUT0,PC1接脉冲;8254硬件连接,CS接320H;.486CODESEGMENTUSE16ASSUMECS:CODEORG1000HBEG:JMPSTARTFIG1DB0BFH,86H,0DBH,0CFH,0E6H,0EDH,0FDH,87H,0FFH,0EFHFIGDB3FH,06H,5BH,4FH,66H,6DH,7DH,07H,7FH,6FHADB?BDB?CDB?DDB?EDB?FDB?NDB?START:;8255控制字及初值MOVDX,30CHMOVAL,10000001BOUTDX,AL;8254控制字及初值MOVDX,32CHMOVAL,00110110B;通道0方式3OUTDX,ALMOVAL,01010110B;通道1方式3OUTDX,ALMOVDX,320HMOVAX,4700DOUTDX,ALMOVAL,AHOUTDX,ALMOVDX,324HMOVAL,3HOUTDX,AL;主程序ST0:MOVA,0MOVB,0MOVC,0MOVD,0MOVE,0MOVF,0MOVN,0ST1:CALLDISPCALLJSTCMPN,1第1页F(2).txtJZK0JMPST1;AK0:CALLJSTCMPN,2HJZRESKA:CALLDISPCALLIN0ANDAL,1HCMPAL,1HJZKAKAA:CALLDISPCALLIN0ANDAL,1HCMPAL,0HJZKAAINCAK00:CMPA,0AHJNZK0INCBJMPK1;BK1:MOVA,0CMPB,0AHJNZK0INCCJMPK2;CK2:MOVAL,CSHLAL,4ADDAL,BCMPAL,6AHMOVB,0JNZK0INCDJMPK3;DK3:MOVC,0CMPD,0AHJNZK0INCEJMPK4;EK4:MOVAL,ESHLAL,4ADDAL,DCMPAL,6AHMOVD,0JNZK0INCFJMPK5第2页F(2).txt;FK5:MOVE,0CMPF,0AHJNZK0JMPST0;子程序DISPDISPPROCLEABX,FIGLEASI,AMOVCX,6HMOVAH,1HDIS:MOVAL,[SI]XLATMOVDX,300HOUTDX,ALMOVDX,304HMOVAL,AHOUTDX,ALCALLDELAY1MOVAL,0OUTDX,ALSHLAH,1INCSILEABX,FIGCALLQWELOOPDISRETDISPENDPQWEPROCCMPAH,2HJZQWE1CMPAH,8HJZQWE1CMPAH,20HJZQWE1JMPQWE2QWE1:LEABX,FIG1QWE2:RETQWEENDP;子程序IN0IN0PROCMOVDX,308HINAL,DXRETIN0ENDPDELAY1PROCPUSHCXMOVCX,1FFHD1:NOPLOOPD1第3页F(2).txtPOPCXRETDELAY1ENDPJSTPROCMOVDX,308HINAL,DXANDAL,2HCMPAL,2HJNZJST0INCNJST00:INAL,DXANDAL,2HCMPAL,0JNZJST00JST0:RETJSTENDPRESPROCRES1:CALLDISPCALLDELAY1CALLDELAY1CALLDELAY1CALLJSTCMPN,3JNZRES1JMPST0RETRESENDPCODEENDSENDBEG第4页
本文标题:计算机硬件—汇编语言—电子跑表
链接地址:https://www.777doc.com/doc-5029883 .html