| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1022 人关注过本帖
标题:关于课程设计的 (霓虹灯)
只看楼主 加入收藏
yuanlinhu
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2007-1-4
收藏
 问题点数:0 回复次数:1 
关于课程设计的 (霓虹灯)

小弟现在快要考试 麻烦大家给点帮助 解释一下~ (越详细越好) 谢谢了~
data_seg SEGMENT
car DB 29
DB 40h,0bh,0,0
DB 40h,0bh,1,0
DB 40h,0bh,1,0
DB 40h,0bh,1,0
DB 40h,0bh,1,0
DB 40h,0bh,1,0
DB 40h,0bh,1,0
DB 40h,0bh,1,0
DB 40h,0bh,1,0
DB 40h,0bh,1,0
DB 40h,0bh,1,0
DB 40h,0bh,1,0
DB 40h,0bh,1,0
DB 40h,0bh,1,0
DB 40h,0bh,1,0
DB 40h,00h,0,1
DB 02ah,0bh,-1,0
DB 02ah,0bh,-1,0
DB 02ah,0bh,-1,0
DB 02ah,0bh,-1,0
DB 02ah,0bh,-1,0
DB 02ah,0bh,-1,0
DB 02ah,0bh,-1,0
DB 02ah,0bh,-1,0
DB 02ah,0bh,-1,0
DB 02ah,0bh,-1,0
DB 02ah,0bh,-1,0
DB 02ah,0bh,-1,0
DB 02ah,0bh,-1,0
;--------------------------------------
jeep DB 28
DB 40h,0bh,0,0
DB 40h,0bh,1,0
DB 40h,0bh,1,0
DB 40h,0bh,1,0
DB 40h,0bh,1,0
DB 40h,0bh,1,0
DB 40h,0bh,1,0
DB 40h,0bh,1,0
DB 40h,0bh,1,0
DB 40h,0bh,1,0
DB 40h,0bh,1,0
DB 40h,0bh,1,0
DB 40h,0bh,1,0
DB 40h,0bh,1,0
DB 40h,0bh,1,0
DB 02ah,0bh,-1,-1
DB 02ah,0bh,-1,0
DB 02ah,0bh,-1,0
DB 02ah,0bh,-1,0
DB 02ah,0bh,-1,0
DB 02ah,0bh,-1,0
DB 02ah,0bh,-1,0
DB 02ah,0bh,-1,0
DB 02ah,0bh,-1,0
DB 02ah,0bh,-1,0
DB 02ah,0bh,-1,0
DB 02ah,0bh,-1,0
DB 02ah,0bh,-1,0
char_cnt1 DW ?
pointer1 DW ?
line_on1 DB ?
col_on1 DB ?
char_cnt2 DW ?
pointer2 DW ?
line_on2 DB ?
col_on2 DB ?
char DW ?
char1 DB ?
char2 DB ?
char3 DB ?
char4 DB ?
count DB ?
count_cx DW ?
data_seg ENDS
;---------------------------------------
code_seg SEGMENT
ASSUME CS:code_seg,DS:data_seg
main PROC FAR
PUSH DS
SUB AX,AX
SUB CX,CX
PUSH AX
PUSH CX
MOV AX,data_seg
MOV DS,AX
MOV char1,1
MOV char2,77
MOV char3,2
MOV char4,76
MOV count,2
CALL clear_screen

again:
MOV char1,1
MOV char2,77
MOV count_cx,CX
LEA DI,car
MOV DH,3
MOV DL,38
CALL move_shape1
LEA DI,jeep
MOV DH,3
MOV DL,40
CALL move_shape2
CALL must_2
DEC count
JNE again
POP CX
RET
main ENDP
;----------------------------
clear_screen PROC NEAR
PUSH AX
PUSH BX
PUSH CX
PUSH DX
MOV AH,6
MOV AL,0
MOV CH,0
MOV CL,0
MOV DH,24
MOV DL,79
MOV BH,7
INT 10h
POP DX
POP CX
POP BX
POP AX
RET
clear_screen ENDP
;-------------------------------------
move_shape1 PROC NEAR
PUSH AX
PUSH BX
PUSH CX
PUSH DX
PUSH DI
MOV AH,0fh
INT 10h
SUB CH,CH
MOV CL,[DI]
INC DI
MOV char_cnt1,CX
MOV pointer1,DI
MOV line_on1,DH
MOV col_on1,DL
MOV char,CX
POP DI
POP DX
POP CX
POP BX
POP AX
RET
move_shape1 ENDP
;----------------------------
move_shape2 PROC NEAR
PUSH AX
PUSH BX
PUSH CX
PUSH DX
PUSH DI
MOV AH,0fh
INT 10h
SUB CH,CH
MOV CL,[DI]
INC DI
MOV char_cnt2,CX
MOV pointer2,DI
MOV line_on2,DH
MOV col_on2,DL
MOV char,CX
POP DI
POP DX
POP CX
POP BX
POP AX
RET
move_shape2 ENDP
;-----------------------------------------
;----------------------------------------
must_2 PROC NEAR
PUSH AX
PUSH BX
PUSH CX
PUSH DX
PUSH DI
MOV AH,0fh
INT 10h
exit4: SUB CX,CX
MOV CX,char_cnt1
MOV DI,pointer1
MOV DH,line_on1
MOV DL,col_on1
MOV char,CX
JMP plot_next

exit3: SUB CX,CX
MOV CX,char_cnt2
MOV DI,pointer2
MOV DH,line_on2
MOV DL,col_on2
MOV char,CX
JMP plot_next
exit5:
CMP char1,DL
JE exit2
CALL dly_qrtr
CALL dly_qrtr
CALL dly_qrtr
CALL erase
JMP exit4
exit2: CMP count,1
JE exit1
CMP char1,37
JE exit1
ADD char1,2
SUB char2,2
ADD char3,2
MOV DL,char3
MOV col_on1,DL
SUB char4,2
MOV DL,char4
MOV col_on2,DL
CALL dly_qrtr
JMP exit4
exit1: CALL erase
POP DI
POP DX
POP CX
POP BX
POP AX
RET
plot_next: ADD DH,[DI+2]
ADD DL,[DI+3]
MOV AH,2
INT 10h
MOV AL,[DI]
MOV BL,[DI+1]
PUSH CX
MOV CX,1
MOV AH,09
INT 10h
POP CX
ADD DI,4
LOOP plot_next
CMP char,28
JE SHORT exit5
JMP exit3
must_2 ENDP
;---------------------------------------------
erase PROC NEAR
SUB CX,CX
MOV CX,char_cnt1
MOV DI,pointer1
MOV DH,line_on1
MOV DL,col_on1
MOV char,CX
JMP erase_next

exit6: SUB CX,CX
MOV CX,char_cnt2
MOV DI,pointer2
MOV DH,line_on2
MOV DL,col_on2
MOV char,CX
erase_next:
ADD DH,[DI+2]
ADD DL,[DI+3]
MOV AH,2
INT 10h
MOV AL,'*'
MOV BL,0
PUSH CX
MOV CX,1
MOV AH,9
INT 10h
POP CX
ADD DI,4
LOOP erase_next
;---------------------------
CMP char,28
JZ left
INC col_on1
MOV DL,col_on1
JMP SHORT exit6
left: DEC col_on2
MOV DL,col_on2
RET

erase ENDP
;-----------------------------------------
dly_qrtr PROC NEAR
PUSH CX
PUSH DX
MOV DX,25
dll: MOV CX,65530
dl2: LOOP dl2
DEC DX
JNZ dll
POP DX
POP CX
RET
dly_qrtr ENDP
;---------------------------------------
code_seg ENDS
END main

搜索更多相关主题的帖子: 课程 霓虹灯 设计 
2007-01-04 16:57
heaiso1985
Rank: 1
等 级:新手上路
帖 子:21
专家分:0
注 册:2006-12-11
收藏
得分:0 
不明白乍回事呀
只有这样一串代码不行呀
2007-01-06 23:58
快速回复:关于课程设计的 (霓虹灯)
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.024701 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved