Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 2

;Pupose:

INCLUDE Irvine32.inc
.stack 100h
.data
INPUT BYTE 20 DUP(0),0
input1 db "Please Enter the value",0
invalid db "Invalid ",0
label1 db "STATE A",0
label2 db "STATE B",0
label3 db "VALID",0
label4 db "STATE D",0
ENTER_KEY = 13
.code
main PROC
mov edx, offset input1 ;move input1
invoke WriteString
call crlf
Loop1:
invoke ReadChar
cmp al,ENTER_KEY
je run
mov input[esi],al
invoke WriteChar
inc esi
loop Loop1
run:
call crlf
mov esi,0
;
mov al,input[esi]

;move ar

ray to al
inc esi
;increase esi to pointer
L1:
cmp al,'1'
; compare eax with 75
je labA
; Go to the ifJump1 if eax is greater than 75
jne
inv
jmp Fi
labA:
mov edx, offset label1
;invoke Writestring
;call crlf
mov al,input[esi]
ray to al
inc esi
;increase esi to pointer
cmp al, '2'
je labB
jne
L1

;move ar

jmp Fi
labB:
mov edx, offset label2
;invoke Writestring
;call crlf
mov al,input[esi]
;move array to al
inc esi
;increase esi to pointer
cmp al, '3'
je labC
jne L1
labC:
mov edx, offset label3
invoke Writestring
call crlf
jmp Fi
labD:
mov edx, offset label4
invoke Writestring
call crlf
mov al,input[esi]
;move array to al
inc esi
;increase esi to pointer
cmp al, '4'
je labB
jne L1

inv:
mov edx, offset invalid
invoke Writestring
call crlf
jmp Fi
Fi:
exit
main ENDP
END main

You might also like