1- برنامه ای بنویسید که در یک حلقه دائم عددی را از ورودی گرفته و مشخص نماید ورودی زوج است یا فرد ؟
include io.h
;---------------------------------
sseg segment stack
DW 256 Dup(?)
sseg ends
;---------------------------------
dseg segment
str DB 20 DUP(?)
prompt DB "Enter your number:",0
msge DB "Even",13,10,0
msgo DB "Odd",13,10,0
temp DB 2
dseg ends
;---------------------------------
cseg segment
assume cs:cseg,ds:dseg
start: mov ax,seg dseg
mov ds,ax
L1: output prompt ;write "Enter your number:"
inputs str,20 ;get your number
cmp cx,0
je L4 ;cmp cx,0 & je L4 ---->Jcxz L4
atoi str
div temp
cmp ah,0
je L2
jmp L3
L2: output msge
jmp L1
L3: output msgo
jmp L1
L4: mov ax,4c00h ;exit to dos
int 21h
cseg ends
end start