DATAS SEGMENT
QIANG_H DB '00000000000000000$'
TITL DB 'Eatting Beans$'
GAME_OVER DB ' Game Over! $'
SCORE DB 'Score:'
;此处输入数据段代码
DATAS ENDS
STACKS SEGMENT
;此处输入堆栈段代码
STACKS ENDS
CODES SEGMENT
ASSUME CS:CODES,DS:DATAS,SS:STACKS
START:
MOV AX,DATAS
MOV DS,AX
;-----------------设置显示方式-----------------
MOV AL,3
MOV AH,0
INT 10H
;-----------------设title光标位置----------------
MOV DH,1
MOV DL,27
MOV BH,0
MOV AH,2
INT 10H
;--。显示title--
LEA DX,TITL
MOV AH,09H
INT 21H
;-----------------。设上围栏光标位置----------------
MOV DH,3
MOV DL,25
MOV BH,0
MOV AH,2
INT 10H
;--。。显示围栏00000--
LEA DX,QIANG_H
MOV AH,09H
INT 21H
;-----------------设下围栏光标位置----------------
MOV DH,15
MOV DL,25
MOV BH,0
MOV AH,2
INT 10H
;--显示围栏00000--
LEA DX,QIANG_H
MOV AH,09H
INT 21H
;-----------------设左围栏光标位置----------------
MOV CL,4;起始横坐标
MOV BL,12 ;12个0
ZUO_WL:
MOV DH,CL
MOV DL,25
MOV BH,0
MOV AH,2
INT 10H
;--显示围栏00000--
MOV DL,30H
MOV AH,02H
INT 21H
INC CL
DEC BL
JNZ ZUO_WL
;-----------------设右围栏光标位置----------------
MOV CL,4;起始横坐标
MOV BL,12 ;12个0
YUO_WL:
MOV DH,CL
MOV DL,41
MOV BH,0
MOV AH,2
INT 10H
;--显示围栏00000--
MOV DL,30H
MOV AH,02H
INT 21H
INC CL
DEC BL
JNZ YUO_WL
;----------------障碍3333333------------------------
;(INT 10H 9号功能 BH页号 AL==ASCII BL=字符属性)
;设置1个3的位置,其余类似
MOV BH,0
MOV DH,4
MOV DL,31
MOV AH,02H
INT 10H
MOV BH,0
MOV CX,1
MOV AL,'3'
MOV BL,4
MOV AH,09
INT 10H
MOV BH,0
MOV DH,4
MOV DL,32
MOV AH,02H
INT 10H
MOV BH,0
MOV CX,1
MOV AL,'3'
MOV BL,4
MOV AH,09
INT 10H
MOV BH,0
MOV DH,4;行
MOV DL,33;列
MOV AH,02H
INT 10H
MOV BH,0
MOV CX,1
MOV AL,'3'
MOV BL,4
MOV AH,09
INT 10H
MOV BH,0
MOV DH,5;行
MOV DL,27;列
MOV AH,02H
INT 10H
MOV BH,0
吃豆子游戏 来自淘豆网m.daumloan.com转载请标明出处.