[求救]玛历医生,一个方块下落.在下等候!程序问题.
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

