; Level and Conditional Statement
.MODEL SMALL
.STACK 100H
.DATA
MSG1 DB 'ENTER AN INPUT: $'
MSG2 DB 'GREATER $'
MSG3 DB 'SMALLER $'
MSG4 DB 'EQUAL $'
NEWLINE DB 0DH, 0AH, '$'
.CODE
MAIN PROC
MOV AX,@DATA
MOV DS,AX
LEA DX,MSG1
MOV AH,9
INT 21H
MOV AH,1
INT 21H
MOV BL,AL
SUB BL,30H
LEA DX,NEWLINE
MOV AH,9
INT 21H
CMP BL,5
JE L2
JL L1 ;JL = Jump if less than
LEA DX,MSG2
MOV AH,9
INT 21H
JMP EXIT ; JMP = Jump
L1:
LEA DX,MSG3
MOV AH,9
INT 21H
JMP EXIT ; JMP = Jump
L2:
LEA DX,MSG4
MOV AH,9
INT 21H
EXIT:
MOV AH,4CH
INT 21H
MAIN ENDP
END MAIN
.MODEL SMALL
.STACK 100H
.DATA
MSG1 DB 'ENTER AN INPUT: $'
MSG2 DB 'GREATER $'
MSG3 DB 'SMALLER $'
MSG4 DB 'EQUAL $'
NEWLINE DB 0DH, 0AH, '$'
.CODE
MAIN PROC
MOV AX,@DATA
MOV DS,AX
LEA DX,MSG1
MOV AH,9
INT 21H
MOV AH,1
INT 21H
MOV BL,AL
SUB BL,30H
LEA DX,NEWLINE
MOV AH,9
INT 21H
CMP BL,5
JE L2
JL L1 ;JL = Jump if less than
LEA DX,MSG2
MOV AH,9
INT 21H
JMP EXIT ; JMP = Jump
L1:
LEA DX,MSG3
MOV AH,9
INT 21H
JMP EXIT ; JMP = Jump
L2:
LEA DX,MSG4
MOV AH,9
INT 21H
EXIT:
MOV AH,4CH
INT 21H
MAIN ENDP
END MAIN
Thanks for providing such a great information. Full Stack Training in Hyderabad
ReplyDelete