Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;**********________*******
- ;GAME VERSION_0.01
- ;
- ;
- .model small
- .stack 100h
- .data
- msg1 dw " WECOME TO PUZZLE WORD!!-V:0.01$"
- msg2 dw " GET READY TO CRACK YOUR BRAIN!!!$"
- msg3 dw " Get Ready$"
- msg4 dw " Give your answers in upper_cse.. Stage 1$"
- msg5 dw " Here Computer Will Give You Some jumble words!!!$"
- msg6 dw " for every right answer you will get 1 point!!! $"
- Q1S1 DW "HAND$" ;QUESTION ANSWER OF FIRST STAGE
- Q2S1 DW "DHAKA$" ;
- Q3S1 DW "CAT$" ;
- 1S2 DW "CHEST$" ;QUESTION ANSWER OF 2ND STAGE
- 2S2 DW "MANGO$" ;
- 3S2 DW "HORSE$" ;
- USER DW 5 DUP('$')
- SCORE DB "WELL PLAYED...!!!.. YOUR SCORE=$"
- Q1 DW "REARRANGE THE JUMBLE WORD:(HINT: A PART OF BODY 'NDAH')$"
- Q2 DW "REARRANGE THE JUMBLE WORD:(HINT: NAME OF A DISTRICT 'HAAKD')$"
- Q3 DW "REARRANGE THE JUMBLE WORD:(HINT: NAME OF AN ANIMAL 'TAC')$"
- FAIL DW "WRONG ANSWER! NICE TRY ! YOU SHOULD TRY AGAIN...'FAILURE IS THE KEY TO SUCCESS..!!$"
- STAGE2 DW "Stage Two...This time No Hints...!!$"
- Q1S2 DW "REARRANGE THE JUMBLE WORD:('ESTHC')$"
- Q2S2 DW "REARRANGE THE JUMBLE WORD:('MNOGA')$"
- Q3S2 DW "REARRANGE THE JUMBLE WORD:('EORSH')$"
- ENDD DW "ALL LEVELS CLEARED..!!..WAIT FOR NEW VERSION..WITH MORE LEVELS$"
- ENDDD DW "...........THAN YOU FOR PLAYING ........,$"
- .CODE
- MAIN PROC
- MOV AX,@DATA ;FOR ACCESSING VARIABLES SENDING ADDRESS OF THE DATA TO DS
- MOV DS,AX ; INISIALIZED HEAP MEMORY
- MOV ES,AX
- MOV BL,30H ;INITIALIZING SCORE
- ;OPENNING OF THE GAME ..
- lea dx,msg1
- mov ah,9
- int 21h
- CALL NEWLINE ;FOR A NEW_LINE
- lea dx,msg2
- mov ah,9
- int 21h
- CALL NEWLINE
- lea dx,msg3
- mov ah,9
- int 21h
- CALL NEWLINE
- CALL NEWLINE
- CALL NEWLINE
- lea dx,msg4
- mov ah,9
- int 21h
- CALL NEWLINE
- CALL NEWLINE
- lea dx,msg5
- mov ah,9
- int 21h
- CALL NEWLINE
- lea dx,msg6
- mov ah,9
- int 21h
- CALL NEWLINE
- ; CODE FOR GAME BEGINS !!!!!!...
- ;QUESTION ONE ..
- CALL NEWLINE
- lea dx,Q1
- mov ah,9
- int 21h
- CALL NEWLINE
- CALL READING
- JMP READ1
- READ_END_Q1: ;FUNCTION FOR COMPARING THE INPUT AND ANSWER
- MOV CX,5 ;INITIALIZE HOW MANY CAR TO COMPARE /LENGTH OF THE BYTE
- LEA SI,Q1S1 ;TARGET STRING
- LEA DI,USER ;USER INPUT
- CLD ;START COMPARING FROM LEFT TO RIGHT
- REPE CMPSB ;REPEAT COMPARING STRING BYTE BY BYTE (REPE=REPAET WHILE EQUAL)(CMPSB=COMPARE STRING BYTE )
- JL MIS1
- JG MIS2
- MOV AX,0
- INC BL
- JMP QUESTION2
- QUESTION2:
- CALL NEWLINE
- CALL NEWLINE
- LEA DX,Q2
- MOV AH,9
- INT 21H
- CALL NEWLINE
- CALL READING
- JMP READ2
- READ_END_Q2:
- MOV CX,5
- LEA SI,Q2S1
- LEA DI,USER
- CLD
- REPE CMPSB
- JL MIS1
- JG MIS2
- MOV AX,0
- INC BL
- JMP QUESTION3
- QUESTION3:
- CALL NEWLINE
- CALL NEWLINE
- LEA DX,Q3
- MOV AH,9
- INT 21H
- CALL NEWLINE
- CALL READING
- JMP READ3
- READ_END_Q3:
- MOV CX,5
- LEA SI,Q3S1
- LEA DI,USER
- CLD
- REPE CMPSB
- JL MIS1
- JG MIS2
- MOV AX,0
- INC BL
- JMP STAGE_2
- ;2ND STAGE BEGINS...!!
- STAGE_2:
- CALL NEWLINE
- CALL NEWLINE
- CALL NEWLINE
- LEA DX,STAGE2
- MOV AH,9
- INT 21H
- CALL NEWLINE
- CALL NEWLINE
- LEA DX,Q1S2
- MOV AH,9
- INT 21H
- CALL NEWLINE
- CALL READING
- JMP READ11
- READ_END_Q11:
- MOV CX,5
- LEA SI,1S2
- LEA DI,USER
- CLD
- REPE CMPSB
- JL MIS1
- JG MIS2
- MOV AX,0
- INC BL
- JMP QUESTION_2
- QUESTION_2:
- CALL NEWLINE
- CALL NEWLINE
- LEA DX,Q2S2
- MOV AH,9
- INT 21H
- CALL NEWLINE
- CALL READING
- JMP READ22
- READ_END_Q22:
- MOV CX,5
- LEA SI,2S2
- LEA DI,USER
- CLD
- REPE CMPSB
- JL MIS1
- JG MIS2
- MOV AX,0
- INC BL
- JMP QUESTION_3
- QUESTION_3:
- CALL NEWLINE
- CALL NEWLINE
- LEA DX,Q3S2
- MOV AH,9
- INT 21H
- CALL NEWLINE
- CALL READING
- JMP READ33
- READ_END_Q33:
- MOV CX,5
- LEA SI,3S2
- LEA DI,USER
- CLD
- REPE CMPSB
- JL MIS1
- JG MIS2
- MOV AX,0
- INC BL
- JMP SCORE_PRINT_2
- READ1: ;FUNCTION TO READ INPUT
- MOV AH,1
- INT 21H
- CMP AL,08H ;FOR BACK SPACE AND CORRECTION ON THAT BACK SPACE POINT ..
- JE B1
- CMP AL,13 ;ENDS READING STRING
- JE READ_END_Q1 ;FUNCTION FOR COMPARING
- MOV [SI],AL ;READS INPUT
- INC SI
- JMP READ1
- B1:
- DEC SI
- DEC AX
- JMP READ1
- READ11:
- ;FUNCTION TO READ INPUT
- MOV AH,1
- INT 21H
- CMP AL,08H
- JE B11
- CMP AL,13 ;ENDS READING STRING
- JE READ_END_Q11 ;FUNCTION FOR COMPARING
- MOV [SI],AL
- INC SI
- JMP READ11
- B11:
- DEC SI
- DEC AX
- JMP READ11
- READ2:
- ;FUNCTION TO READ INPUT
- MOV AH,1
- INT 21H
- CMP AL,08H
- JE B2
- CMP AL,13 ;ENDS READING STRING
- JE READ_END_Q2 ;FUNCTION FOR COMPARING
- MOV [SI],AL
- INC SI
- JMP READ2
- B2:
- DEC SI
- DEC AX
- JMP READ2
- READ22:
- ;FUNCTION TO READ INPUT
- MOV AH,1
- INT 21H
- CMP AL,08H
- JE B22
- CMP AL,13 ;ENDS READING STRING
- JE READ_END_Q22 ;FUNCTION FOR COMPARING
- MOV [SI],AL
- INC SI
- JMP READ22
- B22:
- DEC SI
- DEC AX
- JMP READ22
- READ3:
- ;FUNCTION TO READ INPUT
- MOV AH,1
- INT 21H
- CMP AL,08H
- JE B3
- CMP AL,13 ;ENDS READING STRING
- JE READ_END_Q3 ;FUNCTION FOR COMPARING
- MOV [SI],AL
- INC SI
- JMP READ3
- B3:
- DEC SI
- DEC AX
- JMP READ3
- READ33:
- ;FUNCTION TO READ INPUT
- MOV AH,1
- INT 21H
- CMP AL,08H
- JE B33
- CMP AL,13 ;ENDS READING STRING
- JE READ_END_Q33 ;FUNCTION FOR COMPARING
- MOV [SI],AL
- INC SI
- JMP READ33
- B33:
- DEC SI
- DEC AX
- JMP READ33
- SCORE_PRINT: ;PRINTS SCORE
- CALL NEWLINE
- CALL NEWLINE
- LEA DX,SCORE
- MOV AH,9
- INT 21H
- MOV AH,2
- MOV DL,BL
- INT 21H
- JMP EXIT
- SCORE_PRINT_2: ;AFTER FINISHING
- CALL NEWLINE
- CALL NEWLINE
- LEA DX,SCORE
- MOV AH,9
- INT 21H
- MOV AH,2
- MOV DL,BL
- INT 21H
- CALL NEWLINE
- CALL NEWLINE
- LEA DX,ENDD
- MOV AH,9
- INT 21H
- CALL NEWLINE
- CALL NEWLINE
- CALL NEWLINE
- LEA DX,ENDDD
- MOV AH,9
- INT 21H
- JMP EXIT
- MIS1:
- CALL NEWLINE
- CALL NEWLINE
- MOV AX,1
- LEA DX,FAIL
- MOV AH,9
- INT 21H
- JMP SCORE_PRINT
- JMP EXIT
- MIS2:
- CALL NEWLINE
- CALL NEWLINE
- MOV AX,2
- LEA DX,FAIL
- MOV AH,9
- INT 21H
- JMP SCORE_PRINT
- JMP EXIT
- EXIT:
- MAIN ENDP
- ;READING PROC
- READING PROC
- MOV SI ,OFFSET USER ;SI POINTS TO 1ST INDEX OF THE STRING
- RET
- READING ENDP
- NEWLINE PROC
- MOV AH,2
- MOV DL,0AH
- INT 21H
- MOV AH,2
- MOV DL,0DH
- INT 21H
- RET
- NEWLINE ENDP
- END MAIN
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement