data segment<br>car db 133 ;定义字符图形表<br> db 05h,122,0,0<br> db 05h,122,0,1<br> db 05h,122,0,1<br> db 05h,122,0,1<br> db 05h,122,0,1<br> db 05h,122,0,1<br> db 05h,122,0,1 <br> db 05h,122,1,0<br> db 05h,122,1,0<br> db 05h,122,1,0<br> db 05h,122,0,-1<br> db 05h,122,0,-1<br> db 05h,122,0,-1<br> db 05h,122,0,-1<br> db 05h,122,0,-1<br> db 05h,122,0,-1<br> db 05h,122,-1,0<br> db 05h,122,-1,0<br> db 05h,122,0,3<br> db 05h,122,1,0<br> db 05h,122,2,0<br> db 05h,122,1,0<br> db 05h,122,1,0<br> db 05h,122,1,0<br> db 05h,122,-8,0<br> db 05h,122,-1,0<br> db 05h,122,-1,0<br> db 05h,122,0,7<br> db 05h,122,0,1<br> db 05h,122,0,1<br> db 05h,122,0,1<br> db 05h,122,0,1<br> db 05h,122,0,1<br> db 05h,122,0,1<br> db 05h,122,1,0<br> db 05h,122,1,0<br> db 05h,122,1,0 <br> db 05h,122,1,0<br> db 05h,122,1,0<br> db 05h,122,1,0<br> db 05h,122,1,0<br> db 05h,122,1,0<br> db 05h,122,1,0<br> db 05h,122,1,0 <br> db 05h,122,0,-1<br> db 05h,122,0,-1<br> db 05h,122,0,-1 <br> db 05h,122,0,-1<br> db 05h,122,0,-1<br> db 05h,122,0,-1<br> db 05h,122,-1,0<br> db 05h,122,-1,0<br> db 05h,122,-1,0<br> db 05h,122,-1,0<br> db 05h,122,-1,0<br> db 05h,122,-1,0<br> db 05h,122,-1,0<br> db 05h,122,-1,0<br> db 05h,122,-1,0<br> db 05h,122,2,2<br> db 05h,122,0,1<br> db 05h,122,1,0<br> db 05h,122,1,0<br> db 05h,122,1,0<br> db 05h,122,1,0<br> db 05h,122,0,-1 <br> db 05h,122,-2,0<br> db 05h,122,2,2<br> db 05h,122,-1,0<br> db 05h,122,-1,0<br> db 05h,122,-2,0<br> db 05h,122,0,6<br> db 05h,122,3,0<br> db 05h,122,0,1 <br> db 05h,122,-3,0<br> db 05h,122,-3,1<br> db 05h,122,1,0<br> db 05h,122,1,0<br> db 05h,122,1,0<br> db 05h,122,1,0<br> db 05h,122,1,0<br> db 05h,122,1,0<br> db 05h,122,1,0<br> db 05h,122,1,0<br> db 05h,122,1,0<br> db 05h,122,1,0<br> db 05h,122,0,2<br> db 05h,122,0,1<br> db 05h,122,0,1<br> db 05h,122,-1,-2<br> db 05h,122,-1,0<br> db 05h,122,-1,0<br> db 05h,122,-1,0<br> db 05h,122,-1,0<br> db 05h,122,-1,0<br> db 05h,122,-1,0<br> db 05h,122,0,1<br> db 05h,122,0,1<br> db 05h,122,-1,-2<br> db 05h,122,-1,0<br> db 05h,122,-1,0<br> db 05h,122,0,9 <br> db 05h,122,1,-3 <br> db 05h,122,0,1<br> db 05h,122,0,1<br> db 05h,122,0,1<br> db 05h,122,0,1<br> db 05h,122,0,1<br> db 05h,122,0,1<br> db 05h,122,2,-1<br> db 05h,122,0,-1<br> db 05h,122,0,-1<br> db 05h,122,0,-1<br> db 05h,122,0,-1<br> db 05h,122,1,0<br> db 05h,122,0,4<br> db 05h,122,1,0<br> db 05h,122,0,-1<br> db 05h,122,0,-1<br> db 05h,122,0,-1<br> db 05h,122,0,-1<br> db 05h,122,1,2<br> db 05h,122,1,0 <br> db 05h,122,1,0<br> db 05h,122,1,0<br> db 05h,122,1,0<br> db 05h,122,1,0<br> db 05h,122,-3,-1<br> db 05h,122,0,2<br> db 05h,122,1,1<br> db 05h,122,0,-4<br> db 05h,122,1,-1<br> db 05h,122,0,6<br>char_cnt dw ? <br>pointer dw ?<br>line_on db ?<br>col_on db ?<br>data ends<br>stack segment<br> db 2000 dup (0)<br>stack ends<br>code segment<br> assume cs:code,ds:data,ss:stack<br>main proc far<br> push ds<br> sub ax,ax<br> push ax<br> mov ax,data<br> mov ds,ax<br> <br> mov ah,0<br> mov al,4<br> int 10h<br> <br> mov ah,0bh<br> mov bh,0<br> mov bl,2<br> int 10h<br> <br> mov ah,0bh<br> mov bh,01<br> mov bl,00<br> int 10h<br> <br> call clear_screen ;调用清屏子程序<br> lea di,car<br> mov dh,10<br> mov dl,2<br> call move_shape <br> mov ah,8<br> int 21h<br> cmp al,'q'<br> jz exit<br> main endp <br><br>clear_screen proc near<br> push ax<br> push bx<br> push cx<br> push dx<br> mov ah,6<br> mov al,0<br> mov ch,0<br> mov cl,0<br> mov dh,120<br> mov dl,200<br> mov bh,7<br> int 10h<br> pop dx<br> pop cx<br> pop bx<br> pop ax<br> ret<br>clear_screen endp<br><br>move_shape proc near<br> push ax<br> push bx<br> push cx<br> push dx<br> push di<br> mov ah,0fh<br> int 10h<br> sub ch,ch<br> mov cl,[di]<br> inc di<br> mov char_cnt,cx<br> mov pointer,di<br> mov line_on,dh<br> mov col_on,dl<br>mov_crsr: <br> add dh,[di+2]<br> add dl,[di+3]<br> mov ah ,2<br> int 10h<br> mov al,[di]<br> mov bl,[di+1]<br> push cx<br> mov cx,1<br> mov ah,09<br> int 10h<br> pop cx<br> add di,4<br> loop mov_crsr<br> call dly_qrtr ;调用延时子程序<br> pop di <br> pop dx<br> pop cx<br> pop bx<br> pop ax<br> ret<br>move_shape endp<br><br>dly_qrtr proc near <br> push cx<br> push dx<br> mov dx,5000<br> d11:mov cx,25000 <br> d12:loop d12<br> dec dx<br> jnz d11<br> pop dx<br> pop cx<br> ret<br>dly_qrtr endp<br>exit:mov ah,4ch<br> int 21h<br>code ends<br> end main<br><br><br><br>