Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //dos bios even or odd
- data segment
- string db 0dh,0ah,'Enter a Number Between 0-9 Or Press Q or q To Exit','$',0dh,0ah
- msge db 0dh,0ah,'You Have Entered An Even Number','$',0dh,0ah
- msgo db 0dh,0ah,'You Have Entered An Odd Number','$',0dh,0ah
- data ends
- code segment
- assume cs:code,ds:data
- start: mov ax,data
- mov ds,ax
- disp: lea dx,string
- mov ah,09h
- int 21h
- cmp ah,01h
- int 21h
- cmp al,'q'
- jz exit
- cmp al,'Q'
- jz exit
- cmp al,30h
- jb disp
- cmp al,39h
- ja disp
- sub al,30h
- RCR al,01h
- jc odd
- lea dx,msge
- jmp skip
- odd: lea dx,msgo
- skip: mov ah,09h
- int 21h
- jmp disp
- exit: mov ah,4ch
- int 21h
- code ends
- end start
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement