;-------------------------------------------------------------------------------- ;此模板是纯DOS程序代码,需要MASM5.0,编译时请使用"编译 -> DOS"方式。 ;-------------------------------------------------------------------------------- 逆风者 Init_game macro op1,op2,op3,op4,op5,op6
mov cx,00h mov dh,op1 mov dl,op2 op6: mov ah,02h mov bh,00h int 10h
push cx mov ah,0ah mov al,op3 mov bh,00h mov cx,01h int 10h pop cx
inc cx inc op4 cmp cx,op5 jne op6
endm
clear_screen macro op1,op2,op3,op4 mov ah,06h mov al,00h mov bh,07h mov ch,op1 mov cl,op2 mov dh,op3 mov dl,op4 int 10h
mov ah,02h mov bh,00h mov dh,00h mov dl,00h int 10h endm
menu macro op1,op2,op3 mov ah,02h mov bh,00h mov dh,op1 mov dl,op2 int 10h
mov ah,09h lea dx,op3 int 21h endm
data segment
linjiang db "Made by lin jiang$" no db "NO.:021411$" meg db "Let us have a game!!Come on!!$" meg1 db "**Select Menu**$" meg2 db "Please select the game speed,ESC to quit.$" meg3 db "1.Very slow Too easy,speed up!$" meg4 db "2.Slow Everybody can deal.$" meg5 db "3.Nomal I think you can deal!$" meg6 db "4.Fast A challenge.Pay attention!$" meg7 db "5.Very Fast Too hard,Have a try?$" meg8 db "6.Fastest Are you crazy??$" meg9 db "*Select the number among 1-6 and press ENTER to start!*$" meg10 db "Game Speed Select:$"
hotkey db "When you are playing games:$" hotkey1 db "ESC to return to menu$" hotkey2 db "SPACE to pause the game$" hotkey3 db "Press any key to play games......$" hotkey4 db "Are you ready??$"
failmeg db "The letter is arrive the bottom, You are lost ! :($" failmeg0 db "Press ENTER to go on......$" failmeg1 db "Game is over!$" failmeg2 db "Press ENTER to return menu and press ESC to exit!$" failmeg3 db "Bye-Bye!Thank for your playing!!$" failmeg4 db "Press any key to quit......$"
speed dw 00d,1200d,800d,600d,400d,200d,100d
letters db "jwmilzoeucgpravskntxhdyqfb" db "iytpkwnxlsvxrmofzhgaebudjq" db "nwimzoexrphysfqtvdcgljukda"
letters_bak db "jwmilzoeucgpravskntxhdyqfb" db "iytpkwnxlsvxrmofzhgaebudjq" db "nwimzoexrphysfqtvdcgljukda"
letter_counter db 0 life_flag db 78 dup(0)
position_flag db 78 dup(0) present_position db 1
data ends
stack segment para stack 'stack' db 64 dup(0) stack ends
code segment main proc far assume cs:code,ds:data,ss:stack start:
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
menu 01d,15d,meg ;菜单信息的宏展开 menu 01h,61d,linjiang menu 03d,20d,meg1 menu 03d,68d,no
本文章更多内容:1 - 2 - 3 - 下一页>> |