Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- data segment
- string db 0ah,0dh,'Enter 0-9 Q or q for quit',0ah,0dh,'$'
- msge db 0ah,0dh,'Even no',0ah,0dh,'$'
- msgo db 0ah,0dh,'odd no',0ah,0dh,'$'
- data ends
- code segment
- assume cs:code,ds:data
- start:
- mov ax,data
- mov ds,ax
- display1: lea dx,string
- mov ah,09h
- int 21h
- mov ah,01h
- int 21h
- cmp al,'q'
- jz exit
- cmp al,'Q'
- jz exit
- cmp al,30h
- jb display1
- cmp al,39h
- ja display1
- sub al,30h
- rcr al,01h
- jc odd
- lea dx,msge
- jmp skip
- odd:lea dx,msgo
- skip: mov ah,09h
- int 21h
- jmp display1
- exit : mov ah,4ch
- int 21h
- code ends
- end start
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement