资源描述:
《微机原理课程设计之字符串动画显示》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、dispmacrox,y,lengths,color,flag,varmovah,13h;funnumbermoval,1;themonitorshowmodelmovbh,0;pagenummovbl,color;colormovcx,lengths;strlengthsmovdh,x;strlinemovdl,y;strcolifeflagmovbp,offsetvarelsemovbp,varendif;setthebpvalueint10hendm;---------------------------------------datasegmentlineequ2col
2、orequ5fh;color_boardequ3Dhline1db177,56dup(177),177line2db177,56dup(''),177line3db177,56dup(177),177llequ$-line3xxequ(80-ll)/2line4db"serialportscom1andcom2automatictestprogram"lequ$-line4iequ(80-l)/2;每次右移位显示的起始列号为Ijequi+l-1;第一次左移位显示的起始列号为Jlorgdbj+1lorg1dbl/2+20-3lorg2dbl/2+i+3countdw0count1
3、dw0dataends;-----------------------------CODESEGMENTASSUMECS:CODE,DS:CODE,es:datastart:MOVAX,CODEMOVDS,AXmovax,0b800hMOVES,AXcldAGAIN:MOVAX,3INT10Hleadx,MENU;主菜单movah,9int21hinput:movah,0int16hcp1:cmpal,'1'jnzcp2callsub01;字符串左右移动jmpAGAIN;返回到主菜单cp2:cmpal,'2'jnzcp3callsub02;字符串左右移动jmpAGAIN;返回到
4、主菜单cp3:cmpal,'3'jnzcp4;callsub03;字符串左右移动jmpAGAIN;返回到主菜单cp4:cmpal,'4'jnzcp5;callsub04;字符串左右移动jmpAGAIN;返回到主菜单cp5:cmpal,'5'jnzcp6;callsub05;字符串左右移动jmpAGAIN;返回到主菜单cp6:cmpal,'6';返回DOSjnzinputleadx,MESGmovah,9int21hmovah,1int21hMOVAH,4CHINT21Hsub01:;---------------------------------START1:movax,da
5、tamovds,axmoves,axmovax,3int10h;clearthewindow;------------------------------displine+0,xx,ll,color,0,line1displine+1,xx,ll,color,0,line2displine+2,xx,ll,color,0,line3;-----------------------------;inittheboard;左移位loopstr:inccount;每一次左移位或右移位需要打印的字符数movcx,countdeclorgmovdl,lorg;每次循环减一,使得打印的起始
6、列值左移一位movbp,offsetline4displine+1,dl,cx,color,1,bp;显示右边的数进行左移位calldelay;右移位movbp,offsetline4+l;每次都先使BP指向最后一个字符‘M’的后面一位movcx,countsubbp,cx;使得BP指向要打印的第一个字符displine+1,i,cx,color,1,bp;显示右边的数进行右移位calldelay;调用延迟子程序cmpcount,l;判断是否全部打印结束jneloopstrs:deccountjnzsa:inclorgcmplorg,j+1jnzajmpstartmovah,0
7、1h;调用Dos功能的键盘输入int21hmovah,4ch;结束int21hRETsub02:movax,datamovds,axmoves,axmovax,3int10h;clearthewindow;------------------------------displine+0,xx,ll,color,0,line1displine+1,xx,ll,color,0,line2displine+2,xx,ll,color,0,line3;------------------------