汇编语言写的贪吃蛇小游戏源代码

更新时间:2023-07-06 06:47:11 阅读: 评论:0

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 'e-mail: *******************$'
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 SEGMENTreggae
ASSUME CS:CODE,DS:DATA,SS:STACK
编程java培训班
start:
mov ax,data
mov ds,ax
mov ax,0
mov es,ax
facc
mov frow,10
mov fcol,6
mov dh,10
mov dl,26
language是什么意思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 10hbeautiful soul
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
imankeint 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],offt int9                    ;更改中断向量表
mov es:[9*4+2],cs
jmp aa
write macro  row,col,cnt                                ;宏定义用于向当前光标处输出字符
  push bx
civilians
  push cx
  push dx
  mov dh,row
  mov dl,col
  mov ah,2
  mov bh,0
  int 10h
  mov ah,9
  mov bl,11
  mov cx,1
  lea di,cnt    ;50
  mov al,[di]
  int 10h
  pop dx
  pop cx
  pop bx
endm
readh macro row,col                                        ;宏定义用于读出当前光标处字符         
push dx
push ax
push bx
mov dh,row
foolish是什么意思mov dl,col
mov ah,2
mov bh,0
int 10h
mov ah,08h
int 10h
mov pst,al
pop bx
pop ax
pop dx
endm
wnear macro                                                  ;宏定义只用在readcg宏中当readcg的所有判断都不成立调用此宏
local wnext1
local wnext2
local wnext3
local wnext4
push dx
dec dh
readh dh,dl
cmp pst,1
jne wnext1
write dh,dl,tal2
jmp wnext4
wnext1:
inc dh
dec dl
readh dh,dl
cmp pst,1
jne wnext2
write dh,dl,tal2
jmp wnext4
wnext2:
inc dh
inc dl
readh dh,dl
cmp pst,1
jne wnext3
write dh,dl,tal2
jmp wnext4
wnext3:
dec dh
inc dl
readh dh,dldaddy是什么意思
cmp pst,1
jne wnext4
write dh,dl,tal2
wnext4:
pop dx
endm
readcg macro row,col                                    ;宏定义用于改变判断出来的字符
local tnup,tnup1,tnup2,tnlf,tnlf1,tnlf2,tndn,tndn1,tndn2,tnrt,tnrt1,tnrt2,goout
push bx
push ax
push dx
write dh,dl,tal1
dec row
readh dh,dl
cmp pst,4
jne tnup1
jmp tnup2
tnup1:
jmp near ptr tnup

本文发布于:2023-07-06 06:47:11,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/90/168624.html

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

标签:定义   用于   光标   判断   字符
相关文章
留言与评论(共有 0 条评论)
   
验证码:
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图