[求救]玛历医生,一个方块下落.在下等候!程序问题.

datarea SEGMENT
array dw 135 DUP(?)
color dw ?
count DB 8
score DW 0
x_flag DW ?
y_flag DW ?
n_x DB ?
m_y DB ?
msg0 DB 'congratuations!your score is ','$'
msg1 DB 'good!your score is ','$'
msg2 DB 'very good! your score is','$'
number DB 4
datarea ENDS
stack SEGMENT
DB 256 DUP(?)
tos LABEL WORD
stack ENDS

prognam SEGMENT
main PROC FAR
ASSUME CS:prognam,DS:datarea,SS:stack
start: MOV AX,stack
MOV SS,AX
MOV SP,OFFSET tos
PUSH DS
SUB AX,AX
PUSH AX
CALL CLear_screen
call draw_box
CALL MOVe_box
CALL CLear_screen
CALL DIsplay_score

main ENDP

CLear_Screen PROC NEAR
MOV AX,0600h ;clear screen
or BH,07
MOV CX,0
MOV DX,184fh
INT 10h

MOV AH,0
MOV AL,12h
INT 10h
ret
CLear_Screen ENDP

draw_box proc near
push cx
push dx
MOV CX,150 ;draw background
MOV DX,30
MOV CX,150 ;draw background
MOV DX,30
back1:
MOV AH,0ch
MOV AL,08h
MOV BH,0
INT 10h
INC CX
CMP CX,220
JNZ back1
MOV CX,150
ADD DX,7
CMP DX,177
JNZ back1
MOV CX,150
MOV DX,30
back2:
MOV AH,0ch
MOV AL,08h
MOV BH,0
INT 10h
INC DX
CMP DX,170
JNZ back2
MOV DX,30
ADD CX,7
CMP CX,227
JNZ back2
pop dx
pop cx
RET
draw_box endp

MOVe_box PROC NEAR
GEt_color:
MOV n_x,5
MOV m_y,1
MOV CX,150
MOV DX,62
MOV AL,00110111b
OUT 43h,AL
IN AL,40h
MOV color,AL
MOV array[n_x+m_y*9-9],color
CALL small_box
CMP m_y,15
JZ touch_bottom
CALL delay
MOV AL,color
PUSH AX
MOV color,0
CALL small_box
POP AX
MOV color,AL
ADD CX,8
CALL small_box
JMP GEt_color

touch_bottom:
CALL sound_1
CMP array[n_x+m_y*9-9],array[n_x+m_y*9]
JNZ x_direction
CMP array[n_x+m_y*9],array[n_x+m_y*9-9]
JNZ x_direction
MOV DX,n_x*8+200
MOV CX,(m_y-1)*8+200
CALL cancle_y_box
ADD score,10
JMP GEt_color
x_direction:
MOV count,-1
LOOP1: INC count
CMP count,9
JZ,exit
CMP array[count+(m_y-1)&9],array[count+1+(m_y-1)*9]
JNZ LOOP1
CMP array[count+(m_y-1)*9],array[count+2+(m_y-1)*9]
JNZ LOOP1
MOV DX,count*8+30
MOV CX,(m_y-1)*72+150
CALL cancle_x_box
ADD score,10
exit:RET
MOVe_box ENDP
[2763 byte] By [deshun205-零下七度] at [2007-12-16]
# 1
small_box PROC NEAR
MOV x_flag,DX
MOV y_flag,CX
ADD x_flag,8
ADD y_flag,8
LOOP2:
MOV AH,0ch
MOV AL,color
MOV BH,0
INT 10h
INC CX
CMP CX,y_flag
JNZ LOOP2
SUB CX,8
INC DX
CMP DX,x_flag
JNZ LOOP2
SUB DX,8
RET
samll_box ENDP

copy_small_box PROC NEAR
MOV x_flag,DX
MOV y_flag,CX
ADD x_flag,8
ADD y_flag,8
LOOP7:
MOV AH,0ch
MOV BH,0
INT 10h
INC CX
CMP CX,y_flag
JNZ LOOP7
SUB CX,8
INC DX
CMP DX,x_flag
JNZ LOOP2
SUB DX,8
RET
copy_samll_box ENDP

cancle_y_box PROC NEAR
back1:
MOV x_flag,DX
MOV y_flag,CX
ADD x_flag,8
ADD y_flag,24
SUB number,1
LOOP3:
MOV AH,0ch
MOV AL,number
MOV BH,0
INT 10h
INC CX
CMP CX,y_flag
JNZ LOOP3
SUB CX,24
INC DX
CMP DX,x_flag
JNZ LOOP3
SUB DX,8
CALL delay2
CMP number,0
JA back1
RET
cancle_y_box ENDP
cancle_x_box PROC NEAR
MOV number,4
back2:
MOV x_flag,DX
MOV y_flag,CX
ADD x_flag,24
ADD y_flag,8
SUB number,1
LOOP4:
MOV AH,0ch
MOV AL,number
MOV BH,0
INT 10h
INC DX
CMP DX,x_flag
JNZ loop4
SUB DX,24
INC CX
CMP CX,y_flag
JNZ LOOP4
SUB CX,8
CALLdelay2
RET
cancle_x_box ENDP

delay2 PROC NEAR
PUSH BX
PUSH CX
MOV BX,20
WAIT2:MOV CX,2800
again:LOOP again
DEC BX
JNZ WAIT2
POP CX
POP BX
RET
delay2 ENDP

deshun205-零下七度 at 2007-10-21 > top of Msdn China Tech,其他开发语言,汇编语言...
# 2
delay PROC NEAR
PUSH AX
PUSH BX
PUSH CX
PUSH DX
CMP score,200
JBE num_1
MOV BX,50
JMP WAIT3
num_1:CMP score,100
JBE num_2
MOV 100
JMP WAIT3
num_2:
MOV BX,150
WAIT3:
MOV CX,2800
LOOP5:
MOV AH,2
INT 16h
CMP AL,0
JNZ PROCess
LOOP LOOP5
DEC BX
JNZ WAIT3
JMP exit1
PROCess:
MOV AH,1
INT 16h
CMP AH,50h
JZ turn_down
CMP AH,01h
JZ exit1
CMP AH,4bh
JZ turn_left
CMP AH,4dh
JZ turn_right
JMP LOOP5
turn_left:
CMP n_x,0
JZ loop5
CMP array[n_x-1+9m_y-1)*9],0
JZ LOOP5
MOV DX,n_x*8+200
MOV CX,(m_y-1)*8+150
MOV AL,0
CALL copy_small_box
MOV DX,(n_x-1)*8+30
MOV CX,(m_y-1)*8+150
CALL small_box
JMP LOOP5
turn_right:
CMP n_x,8
JZ LOOP5
CMP array[n_x+1+(m_y-1)*9],0
JZ LOOP5
MOV DX,n_x*8+30
MOV AL,0
CALL copy_small_box
MOV DX,(n_x+1)*8+30
MOV CX,(m_y-1)*8+150
CALL small_box
JMP LOOP5
turn_down:
CMP m_y,15
JZ LOOP5
CMP array[n_x+m_y*9],0
JNZ LOOP5
MOV DX,n_x*8+30
MOV CX,(m_y-1)*8+150
MOV AL,0
CALL copy_small_box
MOV DX,n_x*8+30
MOV CX,m_y*8+150
CALL small_box
JMP LOOP5
exit1:
POP DX
POP CX
POP BX
POP AX
RET
delay ENDP

DIsplay_score PROC NEAR
MOV BX,score
MOV CX,10000d
CALL DEC_div
MOV CX,1000d
CALL DEC_div
MOV CX,100d
CALL DEC_div
MOV CX,10d
CALL DEC_div
MOV CX,1d
CALL DEC_div
RET
DECdiv PROC NEAR
MOV AX,BX
MOV DX,0
DIV CX
MOV BX,DX
MOV DL,AL
ADD DL,30h
MOV AH,2h
INT 21h
RET
DEC_DIV ENDP
DIsplay_score ENDP

sound_1 PROC NEAR
PUSH AX
PUSH BX
PUSH CX
PUSH DX
MOV BX,6000
MOV CX,1000
MOV DX,CX
IN AL,61h
ADD AL,11111100b
trig:
XOR AL,2
OUT 61h,AL
MOV CX,BX
delay3:
LOOP delay3
DEC DX
JNZ trig
POP DX
POP CX
POP BX
POP AX
RET
sound_1 ENDP

print_message PROC NEAR
PUSH AX
PUSH BX
PUSH CX
PUSH DX
CMP score,500
JBE num1
MOV AX,2
JMP to
num1:CMP score,100
JBE num2
MOV AX,1
JMP to
num2:MOV CX,0
to:
MOV BX,OFFSET mesg0
MUL 32
ADD BX,AX
MOV CX,32
DIsp1:MOV DL,[BX]
MOV AL,2
INT 21h
INC BX
LOOP DIsp1
MOV DL,0dh
MOV AH,2
INT 21h
MOV DL,0ah
MOV AL,2
INT 21h
POP DX
POP CX
POP BX
POP AX
RET
print_message ENDP

prognam ENDS
END start

deshun205-零下七度 at 2007-10-21 > top of Msdn China Tech,其他开发语言,汇编语言...
# 3
upup
jtg98g3-跳舞的青蛙 at 2007-10-21 > top of Msdn China Tech,其他开发语言,汇编语言...
# 4
请看一下 http://www.Codefund.cn/expert/topic/993/993118.xml?temp=.6587793 也许对你有帮助.
sum_1-正在喝水 at 2007-10-21 > top of Msdn China Tech,其他开发语言,汇编语言...