有很多模块已经完成了 , 还有些是组合部分的 , 用汇编写游戏还真累啊 , 就光一些模块就要用到20多页的word文档
;******************************
;函数名: Random
;功能: 随机数种子
;传递参数: 空
;函数返回: 空
;******************************
Random proc
push ax
push bx
push cx
push dx
push si
push di
sti
mov ah,0 ;读时钟计数器值
int 1ah
add dx , Seed
and dx , 8fffh
mov Seed , dx
pop di
pop si
pop dx
pop cx
pop bx
pop ax
ret
Random endp
;******************************
;函数名: Rand
;功能: 产生指定范围大小的随机数
;传递参数:
; si 数字的范围最大值+1
;函数返回: ax 返回随机数的值
;******************************
Rand proc
push bx
push cx
push dx
push si
push di
sti
mov ah,0 ;读时钟计数器值
int 1ah
mov ax , Seed
add ax , dx
and ax , 8fffh
mov Seed , ax
mov dx , 0
mov bx , si ;指定随机数的范围
div bx
mov ax , dx
pop di
pop si
pop dx
pop cx
pop bx
ret
Rand endp