- ;write a program that checks wether the entered
- ;number is even or odd using div.
- display macro p1
- mov ah,9
- mov dx,offset p1
- int 21h
- endm
- .model small
- .stack 100h
- .data
- msg1 db 10,13,'even number$'
- msg2 db 10,13,'Odd number$'
- msg3 db 'Please enter any number:$'
- .code
- main proc
- mov ax,@data
- mov ds,ax
- display msg3
- mov ah,1
- int 21h
- mov ah,0
- mov bl,2
- div bl ;ah=reminder; al=quotient
- cmp ah,0
- je L1
- jne L2
- L2:
- display msg2
- jmp end1
- L1:
- display msg1
- jmp end1
- end1:
- mov ah,4ch
- int 21h
- main endp
- end main
Recent Pastes