menu 05d,15d,meg2 menu 07d,15d,meg3 menu 09d,15d,meg4 menu 11d,15d,meg5 menu 13d,15d,meg6 menu 15d,15d,meg7 menu 17d,15d,meg8 menu 19d,15d,meg9 menu 22d,15d,meg10
逆风编程精品 input: mov ah,02h mov bh,00h mov dh,22d mov dl,33d int 10h
mov ah,0ah mov al," " mov bh,00h mov cx,01h int 10h
mov ah,01h int 21h retry: cmp al,"1" je speed1 cmp al,"2" je speed2 cmp al,"3" je speed3 cmp al,"4" je speed4 cmp al,"5" je speed5 cmp al,"6" je speed6 cmp al,1bh je to_over0 jmp input
to_over0:jmp over
speed1: mov ah,01h int 21h cmp al,0dh jne otherkey mov ax,speed 2 mov speed,ax jmp begin
speed2: mov ah,01h int 21h cmp al,0dh jne otherkey mov ax,speed 4 mov speed,ax jmp begin
speed3: mov ah,01h int 21h cmp al,0dh jne otherkey mov ax,speed 6 mov speed,ax jmp begin
speed4: mov ah,01h int 21h cmp al,0dh jne otherkey mov ax,speed 8 mov speed,ax jmp begin
speed5: mov ah,01h int 21h cmp al,0dh jne otherkey mov ax,speed 10 mov speed,ax jmp begin
speed6: mov ah,01h int 21h cmp al,0dh jne otherkey mov ax,speed 12 mov speed,ax jmp begin
otherkey: ; 处理重复输入的代码段
push ax mov ah,02h mov bh,00h mov dh,22d mov dl,34d int 10h
mov ah,0ah mov al," " mov bh,00h mov cx,01h int 10h
mov ah,02h mov bh,00h mov dh,22d mov dl,33d int 10h pop ax
mov dx,ax mov ah,02h int 21h
jmp retry
begin:
clear_screen 01d,01d,23d,78d
menu 08d,20d,hotkey menu 10d,20d,hotkey1 menu 12d,20d,hotkey2 menu 14d,20d,hotkey4 menu 16d,20d,hotkey3
mov ah,07h int 21h
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,50000d 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
本文章更多内容:<<上一页 - 1 - 2 - 3 - 下一页>> |