Assembly Language Guess the Number Game .MODEL SMALL DATA_SEG SEGMENT 'DATA' ST1 DB ST2 DB ST3 DB GAME",'$' ST4 DB ST5 DB ST6 DB ST7 DB ST8 DB
10,13,"ENTER THE NUMBER TO BE GUESS (0-9) ",'$' 10,10,10,13,"ENTER THE NUMBER ",'$' 10,10,13,"CONGRATULATIONS - YOU HAVE WON THE 10,10,13,"OOP'S - GREATER",'$' 10,10,13,"OOP'S - LESSER",'$' 10 DUP (?) 10 DUP (?) "MUHAMMAD FARHAN - 03008855006",'$'
DATA_SEG ENDS CODE_SEG SEGMENT 'CODE' ASSUME CS:CODE_SEG,DS:DATA_SEG MAIN PROC FAR
MOV AX,DATA_SEG MOV DS,AX MOV AH,9 MOV DX,OFFSET ST1 INT 21H MOV AH,7 INT 21H MOV ST6,AL MOV AH,6 MOV AL,0 MOV BH,5FH MOV CH,0 MOV CL,0 MOV DH,54 MOV DL,79 INT 10H AGAIN: MOV AH,9
MOV DX,OFFSET ST2 INT 21H MOV AH,1 INT 21H MOV ST7,AL MOV BL,ST6 CMP ST7,BL JE IFPART CMP ST7,BL JL LPART MOV AH,9 MOV DX,OFFSET ST5 INT 21H JMP AGAIN LPART: MOV AH,9 MOV DX,OFFSET ST4 INT 21H JMP AGAIN IFPART: MOV AH,9 MOV DX,OFFSET ST3 INT 21H MOV AH,7 INT 21H MOV AH,6 MOV AL,0 MOV BH,5FH MOV CH,0 MOV CL,0 MOV DH,54 MOV DL,79 INT 10H MOV AH,2 MOV BH,0 MOV DH,25 MOV DL,25 INT 10H
MOV AH,9 MOV DX,OFFSET ST8 INT 21H MOV AH,7 INT 21H
MOV AH,4CH INT 21H MAIN ENDP CODE_SEG ENDS END MAIN
URL: http://ravianeducation.blogspot.com Mail:
[email protected] Farhan: 03008855006