微机原理课程设计_字符图形显示_汇编课程设计|精品课程网站设计|课程设计网报告总结心得
这是一个显示“中国北京”字样的程序,按“q”键退出。
data segmentcar db 133 ;定义字符图形表db 05h,122,0,0db 05h,122,0,1db 05h,122,0,1db 05h,122,0,1db 05h,122,0,1db 05h,122,0,1db 05h,122,0,1db 05h,122,1,0db 05h,122,1,0db 05h,122,1,0db 05h,122,0,-1db 05h,122,0,-1db 05h,122,0,-1db 05h,122,0,-1db 05h,122,0,-1db 05h,122,0,-1db 05h,122,-1,0db 05h,122,-1,0db 05h,122,0,3db 05h,122,1,0db 05h,122,2,0db 05h,122,1,0db 05h,122,1,0db 05h,122,1,0db 05h,122,-8,0db 05h,122,-1,0db 05h,122,-1,0db 05h,122,0,7db 05h,122,0,1db 05h,122,0,1db 05h,122,0,1db 05h,122,0,1db 05h,122,0,1db 05h,122,0,1db 05h,122,1,0db 05h,122,1,0db 05h,122,1,0db 05h,122,1,0db 05h,122,1,0db 05h,122,1,0db 05h,122,1,0db 05h,122,1,0db 05h,122,1,0db 05h,122,1,0db 05h,122,0,-1db 05h,122,0,-1db 05h,122,0,-1db 05h,122,0,-1db 05h,122,0,-1db 05h,122,0,-1db 05h,122,-1,0db 05h,122,-1,0db 05h,122,-1,0db 05h,122,-1,0db 05h,122,-1,0db 05h,122,-1,0db 05h,122,-1,0db 05h,122,-1,0db 05h,122,-1,0db 05h,122,2,2db 05h,122,0,1db 05h,122,1,0db 05h,122,1,0db 05h,122,1,0db 05h,122,1,0db 05h,122,0,-1db 05h,122,-2,0db 05h,122,2,2db 05h,122,-1,0db 05h,122,-1,0db 05h,122,-2,0db 05h,122,0,6db 05h,122,3,0db 05h,122,0,1db 05h,122,-3,0db 05h,122,-3,1db 05h,122,1,0db 05h,122,1,0db 05h,122,1,0db 05h,122,1,0db 05h,122,1,0db 05h,122,1,0db 05h,122,1,0db 05h,122,1,0db 05h,122,1,0db 05h,122,1,0db 05h,122,0,2db 05h,122,0,1db 05h,122,0,1db 05h,122,-1,-2db 05h,122,-1,0db 05h,122,-1,0db 05h,122,-1,0db 05h,122,-1,0db 05h,122,-1,0db 05h,122,-1,0db 05h,122,0,1db 05h,122,0,1db 05h,122,-1,-2db 05h,122,-1,0db 05h,122,-1,0db 05h,122,0,9db 05h,122,1,-3db 05h,122,0,1db 05h,122,0,1db 05h,122,0,1db 05h,122,0,1db 05h,122,0,1db 05h,122,0,1db 05h,122,2,-1db 05h,122,0,-1db 05h,122,0,-1db 05h,122,0,-1db 05h,122,0,-1db 05h,122,1,0db 05h,122,0,4db 05h,122,1,0db 05h,122,0,-1db 05h,122,0,-1db 05h,122,0,-1db 05h,122,0,-1db 05h,122,1,2db 05h,122,1,0db 05h,122,1,0db 05h,122,1,0db 05h,122,1,0db 05h,122,1,0db 05h,122,-3,-1db 05h,122,0,2db 05h,122,1,1db 05h,122,0,-4db 05h,122,1,-1db 05h,122,0,6char_cnt dw ?pointer dw ?line_on db ?col_on db ?data endsstack segmentdb 2000 dup (0)stack endscode segmentassume cs:code,ds:data,ss:stack
main proc farpush dssub ax,axpush axmov ax,datamov ds,ax
mov ah,0mov al,4int 10h
mov ah,0bhmov bh,0mov bl,2int 10h
mov ah,0bhmov bh,01mov bl,00int 10h
call clear_screen ;调用清屏子程序lea di,carmov dh,10mov dl,2call move_shapemov ah,8int 21hcmp al,'q'jz exitmain endp
clear_screen proc nearpush axpush bxpush cxpush dxmov ah,6mov al,0mov ch,0mov cl,0mov dh,120mov dl,200mov bh,7int 10hpop dxpop cxpop bxpop axretclear_screen endp
move_shape proc nearpush axpush bxpush cxpush dxpush dimov ah,0fhint 10hsub ch,chmov cl,[di]inc dimov char_cnt,cxmov pointer,dimov line_on,dhmov col_on,dlmov_crsr:add dh,[di+2]add dl,[di+3]mov ah ,2int 10hmov al,[di]mov bl,[di+1]push cxmov cx,1mov ah,09int 10hpop cxadd di,4loop mov_crsrcall dly_qrtr ;调用延时子程序pop dipop dxpop cxpop bxpop axretmove_shape endp
dly_qrtr proc nearpush cxpush dxmov dx,5000d11:mov cx,25000d12:loop d12dec dxjnz d11pop dxpop cxretdly_qrtr endpexit:mov ah,4chint 21hcode endsend main