DATA SEGMENT
dw 0,0
snk db 1
blk db 32
food db 3
tal1 db 4
tal2 db 2
adrs db 5
len db ?
pst db ?
addrs dw ?
frow db ?
字符串函数库下载
fcol db ?
hwrt db ?
gmov db 'game over press r to restart press q to quit $'
score1 db 'score :$'
score2 db ?
score0 db 1
zero db 48
writer db 'Developer: Geniusdot    $'
email db ': geniusdotgmail.$'
msg1 db 'The way to play the game:$'
way db ' press w to up ,press s to down,press a to left,press d to right$' msg db 'Press any key(except a,s,d,w) to start$'
DATA ENDS
STACK SEGMENT stack
db 200 dup(0)
STACK ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATA,SS:STACK
start:
mov ax,data
mov ds,ax
mov ax,0
mov es,ax
mov frow,10
mov fcol,6
mov dh,10
mov dl,26
mov ah,2

mov bh,0
int 10h
mov ah,9
lea dx,msg1
int 21h
mov dh,11
mov dl,7
mov ah,2
mov bh,0
int 10h
mov ah,9
lea dx,way
int 21h
mov dh,12
mov dl,20
mov ah,2
mov bh,0
int 10h
mov ah,9
lea dx,msg
int 21h
mov ah,0
int 16h
mov ah,6
mov al,0
mov ch,0
mov cl,0
mov dh,24
mov dl,79
mov bh,10
int 10h
mov dh,0
mov dl,0
mov ah,2
mov bh,0
int 10h
mov ah,9
lea dx,score1
int 21h
mov dl,15
mov ah,2
mov bh,0
int 10h

mov ah,9
lea dx,writer
int 21h
mov ah,9
lea dx,email
int 21h
mov score2,48
push es:[9*4]    ;    将原 int9    入口地
址保存
pop ds:[0]
push es:[9*4+2]
pop ds:[2]

mov word ptr es:[9*4],offset int9

;

更改中断向量表

mov es:[9*4+2],cs

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。