One typing game you have made (compilation)

xiaoxiao2021-04-05  290

The source code is as follows:

Data segment; ******* control class ********

HANGID DB 5; Line number Position DB 0; The starting column of the letter "WHICH DB 0; the positioning of the Si pointer TOTAL DB 0; the total number of MODE1 drop letters or the number of MODE2 buttons DELAYTIME DB 03H; drop delay (difficulty control ) Blank db '', 0H; covered space Outflag DB 0; Record Exit Option Difficultyflag DB 0; Difficulty Option Modeflag DB 0; mode option

******** Data Class ******** Article DB 'Human Vision Like That of Other Primates Has Evolved in An Arboreal Environment In The Dense Complex World of a Tropical Forest It Is More Important To See Well That To Develop An Acute Sense of Smell 'List DB' Abcdefghijklmnopqrstuvwxyz 'Tips1 DB' I ', 0EH,' N ', 0EH,' S ', 0EH,' T ', 0EH,' R ', 0EH,' U ' , 0EH, 'C', 0EH, 'T', 0EH, 'I', 0EH, 'O', 0EH, 'N', 0EH, 'D', 0EH TIPS2 DB 'D', 0EH, 'I', 0eh, 'f', 0eh, 'f', 0eh, 'i', 0eh, 'c', 0eh, 'u', 0eh, 'l', 0eh, 't', 0eh, 'y', 0eh, '', 0eh, 's', 0eh,' e ', 0eh,' l ', 0eh,' e ', 0eh,' c ', 0eh,' t ', 0EH TIPS3 DB' MODE SELECT 'TIPS4 DB' DON '' T USE BACKSPACE OR ARROWS, JUST TYPE THE LETTERS !! 'TIPS5 DB' PRESS ESC TO QUIT 'CONTENT DB' MODE1: SPEED TYPING; MODE2: EXERCISE TYPING 'STR1 DB' YOU HAVE SELECTED ',' $ 'STR2 DB' Press anykey to start game! ',' $ 'Str3 DB' Game Finished! Your Rank Is 'STR4 DB' PRESS ESC to Diplay The Menu 'STR5 DB' Start Time: 'STR6 DB' Accuracy: 'STR7 DB' End Time: 'Max DB' 100% 'Info DB' Version: 0.2 produced by: SURE 'NORMAL DB' NORMAL 'HARD DB' HARD 'MODE1 DB' MODE1 'MODE2 DB' MODE2 'YESQUIT DB' I Want To Quit !! 'NOTQUIT DB' Continue To Play !! 'endl DB 0DH, 0AH,' $ ' Rank DB 0 Score DB 'Score:' Hit DB 'Hit:' MISS DB 'MISS:' Scorenumber DB 0;

Score HitNumber DB 0 Missnumber DB 0 Temp DB 2 DUP (0); Submission calculation results (10) HOUR DB 0; storage hour minute db 0; storage minutes Second DB 0; Storage Second THANKS DB 'THANK YOU Playing! ^ O ^ 'Jieshu DB' Press Any Key To Quit ... 'Data Endsstack Segment Para Stack DW 100 DUP (0) Stack Ends

Code Segment Assume CS: Code, SS: Stack, DS: Data, ES: DATABEGIN: MOV AX, DATA MOV DS, AX MOV ES, AX

MOV BX, 0; save the current display MOV AH, 0FH INT 10H Push AX Push BX

MOV Al, 03H; Set display mode MOV AH, 0 int 10h

****************************** Start interface ************** ****************; ********** Show Welcome Information (Typing Effect) **********

MOV AH, 0EH MOV BH, 0 MOV Al, 'W' Int 10h Call Delay Mov Ah, 0EH MOV BH, 0 MOV Al, 'E' INT 10H Call Delay

MOV AH, 0EH MOV BH, 0 MOV Al, 'L' INT 10H Call Delay

MOV AH, 0EH MOV BH, 0 MOV Al, 'C' INT 10H Call Delay

MOV AH, 0EH MOV BH, 0 MOV Al, 'O' INT 10H Call Delay

MOV AH, 0EH MOV BH, 0 MOV Al, 'M' INT 10H Call Delay

MOV AH, 0EH MOV BH, 0 MOV Al, 'E' INT 10H Call Delay

MOV AH, 0EH MOV BH, 0 MOV Al, '' INT 10H Call Delay

MOV AH, 0EH MOV BH, 0 MOV Al, 'T' INT 10H Call Delay

MOV AH, 0EH MOV BH, 0 MOV Al, 'O' INT 10H Call Delay

MOV AH, 0EH MOV BH, 0 MOV Al, '' INT 10H Call Delay

Mov Ah, 0EH MOV BH, 0 MOV Al, 'T' Int 10h Call Delay Mov Ah, 0EH MOV BH, 0 MOV Al, 'H' INT 10H Call Delay Mov Ah, 0EH MOV BH, 0 MOV Al, 'E' INT 10h Call Delay Mov Ah, 0EH MOV BH, 0 MOV Al, 'Int 10h Call Delay Mov Ah, 0EH MOV BH, 0 MOV Al,' G 'Int 10h Call Delay Mov Ah, 0EH MOV BH, 0 MOV Al, 'A' Int 10h Call Delay Mov Ah, 0EH MOV BH, 0 MOV Al, 'M' INT 10h Call Delay

Mov Ah, 0EH MOV BH, 0 MOV Al, 'E' INT 10h Call Delay Mov Ah, 0EH MOV BH, 0 MOV Al, 'Int 10h Call Delaymov AH, 0EH MOV BH, 0 MOV Al,' W 'INT 10H Call delay

MOV AH, 0EH MOV BH, 0 MOV Al, 'O' INT 10H Call Delay

MOV AH, 0EH MOV BH, 0 MOV Al, 'R' Int 10h Call Delay

MOV AH, 0EH MOV BH, 0 MOV Al, 'L' INT 10H Call Delay

Mov Ah, 0EH MOV BH, 0 MOV Al, 'D' INT 10H Call Delay

MOV AH, 0EH MOV BH, 0 MOV Al, '' INT 10H Call Delay

Mov Ah, 0EH MOV BH, 0 MOV Al, '!' INT 10h Call Delay

MOV AH, 0EH MOV BH, 0 MOV Al, '' INT 10H Call Delay

Mov Ah, 0EH MOV BH, 0 MOV Al, '^' INT 10h Call Delay

Mov Ah, 0EH MOV BH, 0 MOV Al, '_' INT 10h Call Delay

MOV AH, 0EH MOV BH, 0 MOV Al, '^' INT 10H

********** Show additional prompt information ***********

MOV BP, OFFSET INFO MOV CX, 32D MOV DH, 0 MOV DL, 46D MOV Al, 1 MOV BL, 0BH MOV AH, 13H INT 10H

Call endline MOV AH, 09H MOV BH, 0 MOV CX, 80D MOV BL, 02H MOV Al, '*' INT 10h Call endline

MOV BP, OFFSET TIPS1 MOV CX, 12D MOV DH, 04H MOV DL, 0 MOV Al, 03 MOV AH, 13H INT 10H

MOV BP, OFFSET CONTENT MOV CX, 45D MOV DH, 06D MOV DL, 17D MOV Al, 01 MOV BL, 0CH MOV AH, 13H INT 10H

Call endline MOV AH, 09H MOV BH, 0 MOV CX, 80D MOV BL, 02H MOV Al, '*' INT 10h Call endline

MOV AH, 02H MOV BH, 0 MOV DH, 15D MOV DL, 0 INT 10H MOV AH, 09H MOV BH, 0 MOV CX, 80D MOV BL, 02H MOV Al, '*' INT 10H

************ Show selection menu *************

MOV BP, OFFSET TIPS3 MOV CX, 11D MOV DH, 10D MOV DL, 0 MOV Al, 01 MOV BL, 0EH MOV AH, 13H INT 10h Call Modeselect Cmp Modeflag, 0 JE GOGAME1 JMP GOGAME2

GOGAME1: MOV BP, OFFSET TIPS2 MOV CX, 17D MOV DH, 17D MOV DL, 0 MOV Al, 03 MOV AH, 13H INT 10H MOV AH, 02H MOV BH, 0 MOV DH, 22D MOV DL, 0 INT 10h MOV AH, 09H MOV BH, 0 MOV CX, 80D MOV BL, 02H MOV Al, '*' INT 10h Call Select; call difficulty selection menu function MOV AH, 02H MOV BH, 0 MOV DH, 24D MOV DL, 25D INT 10H MOV DX, Offset str1; confirmation difficult option MOV AH, 09H INT 21h CMP Difficultyflag, 0ffh Je Shard Mov Ah, 13H MOV BL, 0EH MOV BH, 0 MOV BP, OFFSET NORMAL MOV AL, 1 MOV CX, 6 MOV DH, 24D MOV DL, 43D INT 10H JMP next1shard: MOV AH, 13H MOV BL, 0EH MOV BH, 0 MOV BP, OFFSET HARD MOV Al, 1 MOV CX, 6 MOV DH, 24D MOV DL, 42D INT 10HNEXT1: MOV DX, OFFSET STR2 MOV AH, 09h INT 21h

MOV AH, 07H INT 21H CMP Difficultyflag, 0; Depending on Selection Difficult Sets Delay and Character Drops JE Next2 MOV DelayTime, 01H MOV TOTAL, 50D JMP next3next2: Mov DelayTime, 04h MOV Total, 50D

;********************************The game starts now*************** ******************

Next3: MOV AH, 05H; Set the current page to MOV Al, 2 int 10h

; ****** Display statistics *******

MOV AH, 13H MOV BH, 2 MOV BL, 0AH MOV CX, 04H MOV DH, 1D MOV DL, 50D MOV Al, 1 MOV BP, OFFSET HIT INT 10H MOV AH, 13H MOV BH, 2 MOV BL, 07H MOV CX, 05H MOV DH, 1D MOV DL, 60D MOV Al, 1 MOV BP, OFFSET MISS INT 10H MOV AH, 13H MOV BH, 2 MOV BL, 0DH MOV CX, 06H MOV DH, 1D MOV DL, 70D MOV Al, 1 MOV BP , Offset Score INT 10H MOV AH, 13H MOV BH, 2 MOV BL, 08H MOV CX, 28D MOV DH, 20D MOV DL, 26D MOV Al, 1 MOV BP, Offset STR4 INT 10H

MOV AH, 02H MOV BH, 2 MOV DH, 3D MOV DL, 0 INT 10H MOV AH, 09H MOV BH, 2 MOV CX, 80D MOV BL, 02H MOV Al, '*' Int 10h MOV AH, 02H MOV BH, 2 MOV DH, 17D MOV DL, 0 INT 10H MOV AH, 09H MOV BH, 2 MOV CX, 80D MOV BL, 02H MOV Al, '*' INT 10H

********** Mode1 main loop ***********

Mainlop: Call setpos Call Whichone MOV BP, Offset List Mov BX, 0 MOV BL, Which Add BP, BX MOV CX, 1 MOV BH, 2; 2 page for MODE1 Game Main Window MOV DH, 05H MOV DL, POSITION MOV Al , 1 MOV BL, 0EH MOV AH, 13H INT 10H Call Down Mov BL, Total; Determines whether to reach the total number of drop characters Dec Bl Mov Total, BL CMP Total, 0 JE Tongji JMP mainlop; ********** Show MODE1 evaluation screen ********* Use 4 page

Tongji: MOV AH, 05H MOV Al, 04H INT 10H

MOV AH, 02H MOV BH, 4 MOV DH, 14D MOV DL, 0 INT 10H MOV AH, 09H MOV BH, 4 MOV CX, 80D MOV BL, 05H MOV Al, '*' INT 10H MOV AH, 02H MOV BH, 4 MOV DH, 18D MOV DL, 0 INT 10H MOV AH, 09H MOV BH, 4 MOV CX, 80D MOV BL, 05H MOV Al, '*' INT 10H MOV AH, 13H MOV BH, 4 MOV BL, 0EH MOV CX, 28D MOV DH, 16D MOV DL, 26D MOV Al, 1 MOV BP, Offset Str3 INT 10h MOV AH, 02H MOV BH, 4 MOV DH, 16D MOV DL, 53D INT 10H MOV AH, 02H MOV BH, 4 MOV DH, 16D MOV DL, 55D INT 10H CMP Scorenumber, 90D; Evaluation Standard JA Next4 CMP Scorenumber, 80D Ja Next6 CMP Scorenumber, 60D JA Next7 MOV Al, 'D' MOV BH, 4 MOV BL, 0CH MOV CX, 1 MOV AH, 09H INT 10H JMP next8Next4: Mov Al, 'S' MOV BH, 4 MOV BL, 0CH MOV CX, 1 MOV AH, 09H INT 10H JMP next8next5: Mov Al, 'A' MOV BH, 4 MOV BL, 0CH MOV CX, 1 MOV AH, 09H INT 10H JMP next8Next6: MOV Al, 'B' MOV BH, 4 MOV BL, 0CH MOV CX, 1 MOV AH, 09H INT 10h JMP next8next7: Mov Al, 'C' MOV BH, 4MOV BL, 0CH MOV CX, 1 MOV AH, 09H INT 10H JMP Next8

NEXT8: MOV AH, 13H MOV BL, 0CH MOV BH, 4 MOV BP, Offset Thanks Mov Al, 1 MOV CX, 26D MOV DH, 22D MOV DL, 45D INT 10H MOV AH, 13H MOV BL, 07H MOV BH, 4 MOV BP, OFFSET JIESHU MOV Al, 1 MOV CX, 25D MOV DH, 23D MOV DL, 50D INT 10H MOV AH, 07H INT 21h MOV AH, 07H INT 21h JMP over; ************ ****** MODE2 game main program ********************

GOGAME2: MOV AH, 02H MOV BH, 0 MOV DH, 20D MOV DL, 45D INT 10H MOV DX, OFFSET STR2 MOV AH, 09H INT 21H MOV AH, 07H INT 21H

MOV AH, 05H; 5 page for MODE2 game page MOV Al, 5D INT 10h MOV AH, 02H MOV BH, 5D MOV DH, 04D MOV DL, 0 INT 10H MOV AH, 09H MOV BH, 5D MOV CX, 80D MOV BL , 02H MOV Al, '*' INT 10H MOV AH, 02H MOV BH, 5D MOV DH, 12D MOV DL, 0 INT 10H MOV AH, 09H MOV BH, 5D MOV CX, 80D MOV BL, 08H MOV Al, '-' INT 10H MOV AH, 02H MOV BH, 5D MOV DH, 20D MOV DL, 0 INT 10H MOV AH, 09H MOV BH, 5D MOV CX, 80D MOV BL, 02H MOV Al, '*' INT 10H MOV BP, OFFSET TIPS4 MOV BH, 05H MOV CX, 54D MOV DH, 22D MOV DL, 13D MOV BL, 0CH MOV Al, 01H MOV AH, 13H INT 10H MOV BP, OFFSET TIPS5 MOV BH, 05H MOV CX, 17D MOV DH, 23D MOV DL, 55D MOV BL, 0AH MOV Al, 01H MOV AH, 13H INT 10H

MOV BP, OFFSET ARTICLE MOV BH, 05H MOV CX, 200D MOV DH, 07D MOV DL, 0 MOV AL, 01H MOV BL, 0EH MOV AH, 13H INT 10H MOV AH, 02H MOV BH, 5D MOV DH, 15D MOV DL, 0 INT 10H MOV SI, OFFSET ARTICLE MOV AH, 2CH INT 21H MOV Minute, Cl Mov Second, DH MOV HOUR, CH; Storage Calculation The result of the calculation (current time converted into seconds) Typelop: Call TypeStart JMP Typelop

********** Show Mode2 evaluation screen ********** (Use 7 page)

Pingjia: MOV AH, 05H MOV Al, 07h INT 10H

MOV AH, 13H MOV BH, 7 MOV BL, 0EH MOV CX, 28D MOV DH, 12D MOV DL, 05D MOV Al, 1 MOV BP, OFFSET STR3 INT 10H MOV AH, 13H; End Information MOV BL, 0CH MOV BH, 07H MOV BP, Offset Thanks Mov Al, 1 MOV CX, 26D MOV DH, 21D MOV DL, 45D INT 10H MOV AH, 13H MOV BL, 07H MOV BH, 07H MOV BP, OFFSET JIESHU MOV Al, 1 MOV CX, 25D MOV DH , 23D MOV DL, 50D INT 10HMOV AH, 02H MOV BH, 7 MOV DH, 14D MOV DL, 0 INT 10H MOV AH, 09H MOV BH, 7 MOV CX, 80D MOV BL, 05H MOV Al, '*' INT 10h MOV AH, 02H MOV BH, 7 MOV DH, 18D MOV DL, 0 INT 10H MOV AH, 09H MOV BH, 7 MOV CX, 80D MOV BL, 05H MOV Al, 'Int 10h MOV BP, OFFSET STR5 MOV BH, 7 MOV CX, 12D MOV DH, 16D MOV DL, 5D MOV AL, 01H MOV AH, 13H MOV BL, 07H INT 10H

*********** Show the time of starting typing ************

MOV AX, 0 MOV AL, HOUR MOV DI, OFFSET TEMP INC DI MOV DX, 0 MOV BX, 10D DIV BX XCHG AX, DX Add Al, 30H MOV [DI], Al Dec Di Add DL, 30H MOV [Di], DL MOV BP, OFFSET TEMP MOV BH, 7 MOV CX, 2 MOV DH, 16D MOV DL, 18D MOV Al, 01H MOV AH, 13H MOV BL, 0EH INT 10H MOV Al, ':' MOV BH, 7D MOV CX, 01H MOV BL, 0EH MOV AH, 09H INT 10H MOV AX, 0 MOV Al, Minute Mov Di, Offset Temp Inc Di Mov DX, 0 MOV BX, 10D Div BX Xchg AX, DX Add Al, 30H MOV [Di], Al Dec Di Add DL, 30H MOV [Di], DL MOV BP, Offset Temp MOV BH, 7 MOV CX, 2 MOV DH, 16D MOV DL, 21D MOV Al, 01H MOV AH, 13H MOV BL, 0EH INT 10H MOV Al, ' : 'MOV BH, 7D MOV CX, 01H MOV BL, 0EH MOV AH, 09H INT 10H MOV AX, 0 MOV Al, Second Mov Di, Offset Temp Inc Di Mov DX, 0 MOV BX, 10D Div BX Xchg AX, DX AddD Al, 30H MOV [DI], Al Dec Di Add DL, 30H MOV [DI], DL MOV BP, OFFSET TEMP MOV BH, 7 MOV CX, 2 MOV DH, 16D MOV DL, 24D MOV AL, 01H MOV AH, 13H MOV BL, 0EH INT 10HMOV BP, Offset Str 7 MOV BH, 7 MOV CX, 9 MOV DH, 16D MOV DL, 32D MOV Al, 01H MOV AH, 13H MOV BL, 07H INT 10H

MOV AH, 2CH; Get Current Time Int 21h Mov Hour, CH MoV Minute, Cl Mov Second, DH

*********** Show the time of the typing end ************

MOV AX, 0 MOV AL, HOUR MOV DI, OFFSET TEMP INC DI MOV DX, 0 MOV BX, 10D DIV BX XCHG AX, DX Add Al, 30H MOV [DI], Al Dec Di Add DL, 30H MOV [Di], DL MOV BP, OFFSET TEMP MOV BH, 7 MOV CX, 2 MOV DH, 16D MOV DL, 42D MOV AL, 01H MOV AH, 13H MOV BL, 0EH INT 10H MOV Al, ':' MOV BH, 7D MOV CX, 01H MOV BL, 0EH MOV AH, 09H INT 10H MOV AX, 0 MOV Al, Minute Mov Di, Offset Temp Inc Di Mov DX, 0 MOV BX, 10D Div BX Xchg AX, DX Add Al, 30H MOV [Di], Al Dec Di Add DL, 30H MOV [DI], DL MOV BP, Offset Temp MOV BH, 7 MOV CX, 2 MOV DH, 16D MOV DL, 45D MOV Al, 01H MOV AH, 13H MOV BL, 0EH INT 10H MOV Al, ' : 'MOV BH, 7D MOV CX, 01H MOV BL, 0EH MOV AH, 09H INT 10H MOV AX, 0 MOV Al, Second Mov Di, Offset Temp Inc Di Mov DX, 0 MOV BX, 10D Div BX Xchg AX, DX AddD Al, 30H MOV [DI], Al Dec Di Add DL, 30H MOV [DI], DL MOV BP, OFFSET TEMP MOV BH, 7 MOV CX, 2 MOV DH, 16D MOV DL, 48D MOV Al, 01H MOV AH, 13H MOV BL, 0EH INT 10HMOV BP, Offset Str 6 MOV BH, 7 MOV CX, 10D MOV DH, 16D MOV DL, 60D MOV Al, 01H MOV AH, 13H MOV BL, 07H INT 10H

******************* Show hits **************************** MOV AX, 0 MOV Al, HitNumber CMP AL , 200D JB Hitnext: MOV BX, 0 MOV BL, 2; seeking the right rate, because it is 200 letters, so the correctly knocking the letter number with 2 Div BL; business in Al, in Ah MoV HitNumber, Al Mov Ch, AH; Temporal AH MOV AX, 0 MOV Al, HitNumber Mov HitNumber, CH; Remove Residency MOV DI, Offset Temp Inc Di Mov DX, 0 MOV BX, 10D Div BX XCHG AX, DX Add Al, 30H MOV [DI], Al Dec Di Add DL, 30H MOV [DI], DL MOV BP, Offset Temp MOV BH, 7 MOV CX, 2 MOV DH, 16D MOV DL, 70D MOV Al, 01H MOV AH, 13H MOV BL, 0EH INT 10H MOV Al, HitNumber Cmp Al, 0 JNZ Dispnext JMP Nodisp; If the correct number is odd, then ".5" Dispnext: Mov Ah, 09h MOV CX, 1 MOV BH, 07H MOV BL, 0EH MOV Al, '.' Int 10h MOV AH, 02H MOV BH, 07H MOV DH, 16D MOV DL, 73D INT 10HMOV AH, 09H MOV BH, 07H MOV CX, 1 MOV BL, 0EH MOV Al, '5' INT 10H

NODISP: MOV AH, 02H MOV BH, 07H MOV DH, 16D MOV DL, 74D INT 10H MOV DL, '%' MOV AH, 02H INT 21H JMP Hitover

Hitmax: MOV BP, Offset Max Mov Bh, 07H MOV DH, 16D MOV DL, 70D MOV CX, 5 MOV Al, 1 MOV BL, 0EH MOV AH, 13H INT 10H

Hitover: MOV AH, 07H INT 21h MOV AH, 07H INT 21h

************* End part **************

OVER: POP BX; Restore Original Parameters POP AX MOV AH, 0; Restore Original Display Mode INT 10H MOV AH, 4CH INT 21h

**************** The following is the subroutine part ****************

SetPOS proc; used to generate the starting position of the alphabet, 2ch; Get System Time INT 21H MOV AX, 0 MOV Al, DL; Time (1/100 Second Unit) divided by 80 to obtain random number MOV BL , 80D Div Bl Mov Position, Ah RetSetPos ENDP

Whichone proc; used to decide which letter MOV AH, 2CH INT 21h; get system time MOV AX, 0 MOV Al, DL MOV BL, 26D; divide time (1/100 seconds) divided by 26 Div Bl Mov Which, Ah RetWhichone Endp

Select Proc; difficulty selection menu Selectlop1: Cmp Difficultyflag, 0FFH; Judgment Current Option JE SELECTLOP2 MOV AH, 06H MOV Al, 0 MOV BH, 07H MOV CH, 18D MOV CL, 0 MOV DH, 19D MOV DL, 79 INT 10H; * ***** Normal selected ********************

MOV AH, 13H MOV BL, 9EH MOV BH, 0 MOV BP, OFFSET NORMAL MOV AL, 1 MOV CX, 6 MOV DH, 18D MOV DL, 36D INT 10H MOV AH, 13H MOV BL, 08H MOV BH, 0 MOV BP, Offset Hard Mov Al, 1 MOV CX, 6 MOV DH, 19D MOV DL, 36D INT 10h JMP SelectNext

******** HARD is selected ***********

SELECTLOP2: MOV AH, 06H MOV Al, 0 MOV BH, 07H MOV CH, 18D MOV CL, 0 MOV DH, 19D MOV DL, 79 INT 10H

MOV AH, 13H MOV BL, 08H MOV BH, 0 MOV BP, OFFSET NORMAL MOV Al, 1 MOV CX, 6 MOV DH, 18D MOV DL, 36D INT 10H MOV AH, 13H MOV BL, 9EH MOV BH, 0 MOV BP, Offset Hard Mov Al, 1 MOV CX, 6 MOV DH, 19D MOV DL, 36D INT 10H

SelectNext: MOV AH, 00; Get Input INT 16H

CMP AH, 48H; on the arrow JE SELECTRESET; reverse CMP AH, 50H; down arrow JE SELECTRESET CMP AH, 1CH; Enter JNE SELECTNEXT; Enter illegal RetSelectreSet: Not Difficultyflag; Sign Dense JMP SelectLop1Select ENDP

ModeSelect Proc; Mode Selection Menu ModeElectrlop1: Cmp Modeflag, 0FFH; Judgment Current Option JE ModestLop2 MOV AH, 06H MOV Al, 0 MOV BH, 07H MOV CH, 12D MOV CL, 0 MOV DH, 13D MOV DL, 79 INT 10H

MOV AH, 13H MOV BL, 9EH MOV BH, 0 MOV BP, OFFSET MODE1 MOV Al, 1 MOV CX, 5 MOV DH, 12D MOV DL, 32D INT 10H MOV AH, 13H MOV BL, 08H MOV BH, 0 MOV BP, Offset Mode2 MOV Al, 1 MOV CX, 5 MOV DH, 12D MOV DL, 41D INT 10H JMP Modeelectrnext

MODESELECTLOP2: MOV AH, 06H MOV Al, 0 MOV BH, 07H MOV CH, 18D MOV CL, 0 MOV DH, 19D MOV DL, 79 INT 10H

MOV AH, 13H MOV BL, 08H MOV BH, 0 MOV BP, OFFSET MODE1 MOV Al, 1 MOV CX, 5 MOV DH, 12D MOV DL, 32D INT 10H MOV AH, 13H MOV BL, 9EH MOV BH, 0 MOV BP, Offset Mode2 MOV Al, 1 MOV CX, 5 MOV DH, 12D MOV DL, 41D INT 10HMODESELECTNEXT: MOV AH, 00; Get Input INT 16H

CMP AH, 4BH; Z arrow JE MODESELECTRESET; reverse CMP AH, 4DH; Y arrow JE MODESELECTRESET CMP AH, 1CH; Enter JNE MODESELECTNEXT; Enter illegal RetModeElectrreSet: Not modeflag; Sign Dear JMP modelectLop1Modelect ENDP1MODESELECT ENDP

Down Proc; Control Character Drop MOV HANGID, 5; From the fifth row, Download Download: Call Refresh; Refresh Score Statistics MOV AH, 01H; Detection Keyboard If you have button input INT 16H JZ DownContinue

MOV AH, 0; if there is, read int 16H MOV BX, 0 MOV BH, 41H; A ASCII code MOV BH, 61H; A of ASCII code add BL, Which; get the current character's ASCII code (BL Updhered, BH is lower-written) Add Bh, Which CMP BL, Al; compares whether the currently read ASCII code and the fallen characters are the same JE DOWNEXT1 CMP BH, Al JE Downnext1 CMP AH, 01H; If the button is ESC, then display Exit Menu Jne DownContinue Call ExitMENU CMP OUTFLAG, 0 JE DOWNCONTINUE2

MOV AH, 13H; Ending information MOV BL, 0CH MOV BH, 3 MOV BP, Offset Thanks Mov Al, 1 MOV CX, 26D MOV DH, 18D MOV DL, 45D INT 10H MOV AH, 13H MOV BL, 07H MOV BH, 3 Mov BP, Offset Jieshu Mov Al, 1 MOV CX, 25D MOV DH, 19D MOV DL, 50D INT 10H MOV AH, 07H INT 21H JMP over

DownContinue2: MOV AH, 05H MOV Al, 02H INT 10HDOWNCONTINUE: MOV CH, 5D MOV CL, 0 MOV DH, 15D MOV DL, 79D MOV BX, 0 MOV AH, 07H MOV Al, 01H INT 10h Call Delay Mov BL, HANGID; Each drop-line HANGID increments 1 (tracking character position) Inc Bl Mov hangid, BL MOV BL, HANGID CMP BL, 15D; SCORENUMBER INC BL INC BL MOV SCORENUMBER, BL MOV BH, HITNUMBER INC BH MOV HITNUMBER, BH CALL DISPEAR; determines that the user key is removed, then HITNUMBER, SCORENUMBER have increased JMP DOWNOVERDOWNNEXT2: MOV BX, 0 MOV BL, MISSNUMBER INC BL MOV MISSNUMBER, BL Call Dispear; Decide the character to the bottom passive elimination, then Missnumber adds Downover: retdown endpdelay proc; delay function MOV AH, 0 int 1ah; Direct read clock counter MOV BX, DX MOV AX, 0 MOV Al, DelayTime; plus DELAY interval Add bx, AxdeLaylop: MOV AH, 0 INT 1AH CMP DX, BX JE DELAYNEXT JMP DelayLopdeLaynext: Retdelay Endp

Dispear proc; eliminate function MOV BP, Offset Blank; essence is written in space in the location of the current character, covering the original characters MOV CX, 1 MOV BH, 2 MOV DH, HANGID; the current character is located Mov DL, position; current characters MOV Al, 3 MOV AH, 13H INT 10h Retdispear ENDP

ExitMenu Proc; Exit Menu (page 3) MOV AH, 05H MOV Al, 03H INT 10H MOV AH, 02H MOV BH, 3 MOV DH, 10D MOV DL, 0 INT 10H MOV AH, 09H MOV BH, 3 MOV CX, 80D MOV BL, 02H MOV Al, '*' INT 10H MOV AH, 02H MOV BH, 3 MOV DH, 15D MOV DL, 0 INT 10H MOV AH, 09H MOV BH, 3 MOV CX, 80D MOV BL, 02H MOV Al, ' * 'INT 10h

******** NOTQUIT is selected **********

Exitlop1: CMP OUTFLAG, 0FFH; Judgment Current Option JE EXITLOP2 MOV AH, 06H MOV Al, 0 MOV BH, 07H MOV CH, 12D MOV CL, 0 MOV DH, 13D MOV DL, 79 INT 10H

MOV AH, 13H MOV BL, 9EH MOV BH, 3 MOV BP, OFFSET NOTQUIT MOV Al, 1 MOV CX, 18D MOV DH, 12D MOV DL, 32D INT 10H MOV AH, 13H MOV BL, 08H MOV BH, 3 MOV BP, Offset YESQUIT MOV Al, 1 MOV CX, 18D MOV DH, 13D MOV DL, 32D INT 10H JMP EXITNEXT; ******* YESQUIT is selected **********

Exitlop2: MOV AH, 06H MOV Al, 0 MOV BH, 07H MOV CH, 12D MOV CL, 0 MOV DH, 13D MOV DL, 79 INT 10H

MOV AH, 13H MOV BL, 08H MOV BH, 3 MOV BP, OFFSET NOTQUIT MOV Al, 1 MOV CX, 18D MOV DH, 12D MOV DL, 32D INT 10H MOV AH, 13H MOV BL, 9EH MOV BH, 3 MOV BP, Offset Yesquit Mov Al, 1 MOV CX, 18D MOV DH, 13D MOV DL, 32D INT 10H

EXITNEXT: MOV AH, 00; Get Input INT 16H

CMP AH, 48H; Up to CMP AH, 50H; Under Arrow JE EXITRESET CMP AH, 1CH; Enter JNE EXITNEXT; Enter illegal ReteXitRex: NOT OUTFLAG; Sign Dense JMP Exitlop1ExitMenu ENDP

Endline Proc; Print Enter Ranking MOV DX, Offset Endl Mov Ah, 09h Int 21h

MOV DX, OFFSET ENDL MOV AH, 09H INT 21H RETENDLINE ENDP

Refresh Proc; refreshing grade statistics; ****** Each statistical count (16) except 10 additional amount of 10, and stored in TEMP, write the digital MOV stored in TEMP in the corresponding position AX, 0 MOV AL, HITNUMBER MOV DI, OFFSET TEMP INC DI MOV DX, 0 MOV BX, 10D DIV BX XCHG AX, DX Add Al, 30H MOV [DI], Al Dec Di Add DL, 30H MOV [DI], DL MOV BP, Offset Temp MOV BH, 02H MOV CX, 2 MOV DH, 1D MOV DL, 55D MOV AL, 01H MOV AH, 13H MOV BL, 0EH INT 10H MOV AX, 0 MOV Al, Missnumber Mov Di, Offset Temp Inc DI MOV DX, 0 MOV BX, 10D DIV BX XCHG AX, DX Add Al, 30H MOV [DI], Al Dec Di Add DL, 30H MOV [Di], DL MOV BP, OFFSET TEMP MOV BH, 02H MOV CX, 2 MOV DH, 1D MOV DL, 66D MOV Al, 01H MOV AH, 13H MOV BL, 0EH INT 10h MOV AX, 0 MOV Al, Scorenumber Mov Di, Offset Temp Inc DI MOV DX, 0 MOV BX, 10D Div BX XCHG AX, DX Add Al, 30H MOV [DI], Al Dec Di Add DL, 30H MOV [DI], DL MOV BP, OFFSET TEMP MOV BH, 02H MOV CX, 2 MOV DH, 1D MOV DL, 77D MOV AL, 01H MOV AH, 13H MOV BL, 0EH INT 10h Retrefresh EndPTypeStart Proc; MODE2 Mode Main Working Function MOV AH, 01H INT 21H CMP Al, 1BH; If the button is ESC, directly exit JNE NOESC directly

MOV AH, 05H MOV Al, 06H; 6 page as MODE2 Exit Screen INT 10H MOV AH, 13H; End Information MOV BL, 0CH MOV BH, 06H MOV BP, OFFSET THANKS MOV Al, 1 MOV CX, 26D MOV DH, 18D MOV DL, 45D INT 10h MOV AH, 13H MOV BL, 07H MOV BH, 06H MOV BP, OFFSET JIESHU MOV Al, 1 MOV CX, 25D MOV DH, 19D MOV DL, 50D INT 10H MOV AH, 07H INT 21h JMP over

NOESC: MOV BL, [SI] CMP AL, BL JNE TYPEWRONG MOV BL, HITNUMBER INC BL MOV HITNUMBER, BLTYPEWRONG: MOV BL, TOTAL INC BL MOV TOTAL, BL CMP BL, 200D JNE TYPENEXT JMP PINGJIA TYPENEXT: INC SI RETTYPESTART ENDP

Code endsend begin

转载请注明原文地址:https://www.9cbs.com/read-132183.html

New Post(0)