📄 fmenu.asm
字号:
quit1: call main
ret
;***清屏***
clear proc near
push ax
push bx
push cx
push dx
mov ah,6
mov al,0
mov ch,0
mov cl,0
mov dh,24
mov dl,79
mov bh,7
int 10h
pop dx
pop cx
pop bx
pop ax
ret
clear endp
appg1 endp
appg2 proc near ;功能软件2
mov ax,data
mov ds,ax
mov letter_counter,00h
mov present_position,1
lea si,position_flag
mov ah,00h
mov cx,00h
init_postion_flag:
mov [si],ah
inc si
inc cx
cmp cx,78d
jne init_postion_flag
lea di,letters
lea si,letters_bak
mov cx,00h
init_letters:
mov ah,[si]
mov [di],ah
inc si
inc di
inc cx
cmp cx,78d
jne init_letters
mov ah,00h
lea si,life_flag
mov cx,00h
init_life_flag:
mov [si],ah
inc si
inc cx
cmp cx,78d
jne init_life_flag
mov cx,00h
mov ah,01h
or ch,00010000b
int 10h
clear_screen 00d,00d,24d,79d
Init_game 00d,00d,0ah,dl,80d,nextsign1
Init_game 24d,00d,0ah,dl,80d,nextsign2
Init_game 00d,00d,0ah,dh,25d,nextsign3
Init_game 00d,79d,0ah,dh,25d,nextsign4
menu2 05d,15d,ZK ;菜单信息的宏调用
menu2 07h,15d,no
menu2 09d,15d,meg
menu2 11d,15d,meg1
menu2 13d,15d,meg2
menu2 15d,15d,meg3
menu2 17d,15d,meg4
put: mov ah,02h ;设置光标位置
mov bh,00h
mov dh,22d
mov dl,33d
int 10h
mov ah,01h ;从键盘输入任意字符
int 21h
cmp al,0dh
je speed3
cmp al,45h
je quit2
quit2: call main
ret
speed3: mov ax,speed+12
mov speed,ax
jmp begin
begin: clear_screen 01d,01d,23d,78d ;清屏宏调用
clear_screen 01d,01d,23d,78d
Init_game 23d,01d,01h,dl,78d,nextsign5
mov ah,02h
mov bh,00h
mov dh,01h
mov dl,01h
int 10h
mov cx,00h
lea si,letters
nextletter:
mov ah,02h ;显示字母
mov dl,[si]
int 21h
inc si
inc cx
cmp cx,78d
je nextcycle
jmp nextletter
from_front:
sub present_position,78d
jmp gobackto_si
find_zero:
cmp letter_counter,78d
je recycle
cmp present_position,78d
je from_one
mov ah,00h
nextsi: add present_position,01h
inc si
cmp [si],ah
je gobackto_di
cmp present_position,78d
je from_one
jmp nextsi
from_one:mov present_position,01h
jmp gobackto_si
recycle:mov letter_counter,00h
mov present_position,01d
lea si,position_flag
mov cx,00h
mov ah,00h
clearsi: mov [si],ah
inc cx
cmp cx,78d
je nextcycle
inc si
jmp clearsi
nextcycle:
lea di,letters
lea si,position_flag
add present_position,31d
cmp present_position,78
ja from_front
gobackto_si:
add si,word ptr present_position
dec si
mov ah,[si]
cmp ah,01h
je find_zero
gobackto_di:
mov ah,01h
mov [si],ah
add di,word ptr present_position
dec di
mov dl,present_position
mov ah,02h
mov bh,00h
mov dh,01h
int 10h
mov cx,00h
nextrow: push cx
mov cx,00h
out_cycle: ; 延迟
push cx
mov cx,00h
in_cycle:
add cx,01h
cmp cx,1000
jne in_cycle
push dx
mov ah,06h ;从键盘输入字符
mov dl,0ffh
int 21h
pop dx
jz pass
cmp al,1bh ;如果键入ESC,则返回主菜单
je to_start1
cmp al," " ;如果键入SPACE,则游戏暂停
je pause
cmp al,[di] ;输入字母正确!则字母消失
je disappear
pass: pop cx
inc cx
cmp cx,speed
je print
jmp out_cycle
pause: push dx ;暂停处理
mov ah,06h
mov dl,0ffh
int 21h
pop dx
cmp al," "
jne pause
jmp pass
to_start1: ;返回主菜单
jmp start
print:
mov ah,0ah ;在当前光标位置写空格
mov al," "
mov bh,00h
mov cx,01h
int 10h
inc dh
mov ah,02h ;改变光标位置
mov bh,00h
int 10h
mov ah,0ah ;在当前光标位置写字母
mov al,[di]
mov bh,00h
mov cx,01h
int 10h
pop cx
inc cx
cmp cx,21d
je print_next_letter
jmp nextrow ;下一行
disappear: ;击中字母后输出空格
pop cx
pop cx
mov ah,0ah
mov al," "
mov bh,00h
mov cx,01h
int 10h
jmp hit
print_next_letter:
lea si,life_flag
add si,word ptr present_position
dec si
mov ah,0ah
mov al," "
mov bh,00h
mov cx,01h
int 10h
inc dh
mov ah,02h
mov bh,00h
int 10h
mov ah,0ah
mov al," "
mov bh,00h
mov cx,01h
int 10h
mov ah,1
mov [si],ah
hit: mov ah,02h
mov bh,00h
mov dh,01h
mov dl,present_position
int 10h
mov al,[di] ; 出现下一个新字母的数法
add al,7
cmp al,7ah
ja convey_letter
mov ah,0ah
mov bh,00h
mov cx,01h
int 10h
mov [di],al
add letter_counter,01h
jmp nextcycle
convey_letter:
sub al,7ah
add al,61h
mov ah,0ah
mov bh,00h
mov cx,01h
int 10h
mov [di],al
add letter_counter,01h
jmp nextcycle
clear_screen 01,01,23,78
mov ah,02h
mov bh,00h
mov dh,11d
mov dl,20d
int 10h
inc dh
inc dh
mov ah,02h
mov bh,00h
int 10h
notkey:
mov ah,07h
int 21h
cmp al,0dh
je to_start
cmp al,1bh
je over
jmp notkey
to_start:
clear_screen 00,00,24,79
jmp start
over: clear_screen 01,01,23,78
mov ah,02h
mov bh,00h
mov dh,11d
mov dl,15h
int 10h
mov ah,02h
mov bh,00h
mov dh,13d
mov dl,15h
int 10h
mov ah,07h
int 21h
mov ah,07h
int 21h
clear_screen 00,00,24,79
mov ax,4c00h
int 21h
appg2 endp
appg3 proc near ;功能软件3
win 0,7eh,1,0,30,79
main3 proc far
assume cs:code,ds:data
start3:
push ds
sub ax,ax
push ax
mov ax,data
mov ds,ax
mov ah,00
mov al,04
int 10h
mov ah,0bh
mov bh,00
mov bl,1
int 10h
mov ah,0bh
mov bh,1
mov bl,2
int 10h
mov dx,offset buff1 ;显示提示信息
mov ah,09
int 21h
mov ah,08
int 21h
call clear3 ;cls
sss:
call text ;display the text
mov di,2
mov al,1 ;draw the big box
mov cx,70
mov dx,20
mov bx,160
call box
mov cx,71
mov dx,21
mov bx,158
again:
mov al,1
mov di,0
call box
call delay
mov al,0
mov di,0
call box
inc cx
inc dx
sub bx,2
cmp cx,94
jnz again
mov di,0 ;draw the 2nd box
mov cx,95
mov dx,45
mov al,1
mov bx,110
call box
mov cx,96
mov dx,46
mov bx,108
again_00:
mov al,1
mov di,0
call box
call delay
call delay
mov al,0
mov di,0
call box
inc cx
inc dx
sub bx,2
cmp cx,114
jnz again_00
mov cx,115 ;draw the 3rd box
mov dx,65
mov al,1
mov bx,70
call box
mov cx,116
mov dx,66
mov bx,68
again_01:
mov al,1
mov di,0
call box
call delay
call delay
mov al,0
mov di,0
call box
inc cx
inc dx
sub bx,2
cmp cx,129
jnz again_01
mov di,2
mov al,1 ;draw the small box
mov cx,130
mov dx,80
mov bx,40
call box
mov di,2
mov al,3 ;对角线
mov si,0
mov cx,71
mov dx,21
mov bx,59
call xie_line
mov cx,171
mov dx,121
mov bx,59
call xie_line
mov si,1
mov cx,71
mov dx,179
mov bx,59
call xie_line
mov cx,171
mov dx,79
mov bx,59
call xie_line
mov cx,150 ;十字线
mov dx,20
mov si,0
mov bx,60
call draw_line
mov cx,150
mov dx,120
mov bx,60
call draw_line
mov cx,70
mov dx,100
mov si,1
mov bx,60
call draw_line
mov cx,170
mov dx,100
mov bx,60
call draw_line
mov si,1
mov cx,70
mov dx,60
mov bx,60
call mid_line
mov cx,170
mov dx,110
mov bx,60
call mid_line
mov si,2
mov cx,110
mov dx,20
mov bx,30
call mid_line
mov cx,160
mov dx,120
mov bx,30
call mid_line
mov si,3
mov cx,70
mov dx,140
mov bx,60
call mid_line
mov cx,170
mov dx,90
mov bx,60
call mid_line
mov si,4
mov cx,110
mov dx,180
mov bx,30
call mid_line
mov cx,160
mov dx,80
mov bx,30
call mid_line
mov di,0
mov al,1 ;draw the big box again
mov cx,70
mov dx,20
mov bx,160
call box
mov di,0
mov al,1 ;draw the small box again
mov cx,130
mov dx,80
mov bx,40
call box
mov di,0
mov cx,95
mov dx,45
mov al,1
mov bx,110
call box
mov cx,115
mov dx,65
mov al,1
mov bx,70
call box
mov di,1 ;fill
call fill
call fill_2
call fill_3
mov cx,149 ;bold
mov dx,120
mov al,2
mov bx,60
mov si,0
call draw_line
mov cx,151
mov dx,120
mov al,2
mov bx,60
mov si,0
call draw_line
heart_: ;draw the heart
call cls_box
call heart
mov ah,08
int 21h
cmp al,'q'
jz ok
cmp al,20h
jz heart_
call clear3
jmp sss
ok:
call main
ret
main3 endp
fill proc near ;the procedure of fill
mov full,0
mov al,5
mov cx,160
mov dx,121
mov si,0
mov bx,60
fill_Y:
push cx
push dx
push bx
call draw_line
pop bx
pop dx
pop cx
sub bx,2
inc cx
add dx,2
inc full
cmp full,30
jne fill_y
ret
fill endp
fill_2 proc near
mov full,0
mov al,5
mov cx,140
mov dx,121
mov si,0
mov bx,60
fill_Y1:
push cx
push dx
push bx
call draw_line
pop bx
pop dx
pop cx
sub bx,2
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -