【正文】
P AXENDM 初始化顯示模式initShowModel MACRO A 。 PUSH AX MOV AH,0 。用來設(shè)定顯示模式的服務(wù)程序 MOV AL,A 。AL 寄存器表示欲設(shè)定的模式 INT 10H POP AXENDM初始化窗口或窗口內(nèi)容向上卷動,也可以用于清屏initWindow MACRO A,B,C1,C2,D1,D2 。 PUSH AX PUSH BX PUSH CX PUSH DX MOV AH,6 MOV AL,A 。上卷行數(shù) MOV BH,B 。卷入行屬性(顏色) MOV CH,C1 。左上角行號 MOV CL,C2 。左上角列號 MOV DH,D1 。右下角行號 MOV DL,D2 。右下角列號 INT 10H POP DX POP CX POP BX POP AXENDM Pause MACRO PUSH AX MOV AH,01H INT 21H POP AXENDM 數(shù)據(jù)段定義 DATA_SEG SEGMENT 。 GameMenu DB 39。Wele Use Caiquan Game39。,0dh,0ah,39。$39。 。主菜單 DB 39。Play Game39。,0dh,0ah,39。$39。 DB 39。About39。,0dh,0ah,39。$39。 DB 39。Exit game39。,0dh,0ah,39。$39。 DisW DB 39。 Win : Time 39。,0dh,0ah,39。$39。 DisF DB 39。 Fail : Time 39。,0dh,0ah,39。$39。DisE DB 39。 You have Equel: Time 39。,0dh,0ah,39。$39。 Dispay2 DB 39。 This Time You Win ! 39。,0dh,0ah,39。$39。Dispay3 DB 39。 This Time You Failed ! 39。,0dh,0ah,39。$39。Dispay4 DB 39。 This Time You Equel to PC ! 39。,0dh,0ah,39。$39。Dispay5 DB 39。 Enter Enter to continue ! 39。,0dh,0ah,39。$39。Dispay6 DB 39。 Enter ESC to Exit! 39。,0dh,0ah,39。$39。Dispayt DB 39。 You choose the Tone! 39。,0dh,0ah,39。$39。Dispays DB 39。 You choose the Scissor! 39。,0dh,0ah,39。$39。Dispayc DB 39。 You choose the Cloth! 39。,0dh,0ah,39。$39。Dispayyt DB 39。 PC choose the Tone! 39。,0dh,0ah,39。$39。Dispayys DB 39。 PC choose the Scissor! 39。,0dh,0ah,39。$39。Dispayyc DB 39。 PC choose the Cloth! 39。,0dh,0ah,39。$39。 Kick DB ? R_NUM DB ?NUM DB ? X DB ?Y DB ? FAI DB 48 WIN DB 48EQ DB 48 EXITMsg DB 39。You really want to exit!39。,39。$39。 DB 39。Enter Y to exit39。,39。$39。 DB 39。Enter N to continue!39。,39。$39。 Information DB 39。Author information39。,0dh,0ah,39。$39。 DB 39。Name: Li Fang39。,0dh,0ah,39。$39。 DB 39。Class: jisuanji 139。,0dh,0ah,39。$39。 DB 39。Student ID: 20111460011539。,0dh,0ah,39。$39。 Char DB ? LineA DB 39。 You Have Beginning Game ! 39。,0dh,0ah,39。$39。 LineB DB 39。39。,0dh,0ah,39。$39。lineF DB 39。 Please Input0or1or2 39。,0dh,0ah,39。$39。LineC DB 39。0tone 39。,0dh,0ah,39。$39。LineC1 DB 39。1Scissor 39。,0dh,0ah,39。$39。LineC2 DB 39。2Cloth 39。,0dh,0ah,39。$39。LineD DB 39。/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/39。,0dh,0ah,39。$39。LineE DB 39。 Input your choose Here: 39。,0dh,0ah,39。$39。LineE1 DB 39。 Input Error! Please input again39。,0dh,0ah,39。$39。LineE2 DB 39。 Choose a number from 02 input39。,0dh,0ah,39。$39。Linet DB 39。 Enter Tab to Restart! 39。,0dh,0ah,39。$39。 DATA_SEG ENDS堆棧段定義 STACK_SEG SEGMENT STACK 。 STACK_BUF DW 120 DUP(?)TOP EQU $STACK_BUFSTACK_SEG ENDS 程序代碼區(qū)CODE_SEG SEGMENT 。 ASSUME CS:CODE_SEG,DS:DATA_SEG,SS:STACK_SEG MAIN PROC FARSTART: MOV AX,STACK_SEG MOV SS,AX MOV SP,TOP MOV AX,DATA_SEG MOV DS,AXBEGIN: initShowModel 0H initWindow 0,9EH,0,0,25,40 。宏調(diào)用MENU: setCurPos 2,2,0 showString LineD setCurPos 4,9,0 。設(shè)置主菜單光標(biāo)位置 showString GameMenu setCurPos 8,15,0 showString GameMenu[27] setCurPos 12,15,0 showString GameMenu[39] setCurPos 16,15,0 showString GameMenu[47] setCurPos 21,2,0 showString LineD setCurPos 8,12,0 showChar 39。39。 Keyboad: getChar Kick 。菜單選擇部分 CMP Kick,9 。按的是鍵TAB