資源描述:
《微機(jī)原理課程設(shè)計之字符串動畫顯示》由會員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在工程資料-天天文庫。
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;每一次左移位或右移位需要打印的字符數(shù)movcx,countdeclorgmovdl,lorg;每次循環(huán)減一,使得打印的起始
6、列值左移一位movbp,offsetline4displine+1,dl,cx,color,1,bp;顯示右邊的數(shù)進(jìn)行左移位calldelay;右移位movbp,offsetline4+l;每次都先使BP指向最后一個字符‘M’的后面一位movcx,countsubbp,cx;使得BP指向要打印的第一個字符displine+1,i,cx,color,1,bp;顯示右邊的數(shù)進(jìn)行右移位calldelay;調(diào)用延遲子程序cmpcount,l;判斷是否全部打印結(jié)束jneloopstrs:deccountjnzsa:inclorgcmplorg,j+1jnzajmpstartmovah,0
7、1h;調(diào)用Dos功能的鍵盤輸入int21hmovah,4ch;結(jié)束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;------------------------