INCLUDE PCMAC.INC
	.MODEL SMALL
	.586
	.STACK 100h

	.DATA
msg1	DB	"Please enter a number:$"
msg2	DB	"The number is prime.$"
msg3	DB	"The number is NOT prime.$"
num	DW	?
savax	DW	?
	.CODE
	EXTERN GetDec: NEAR
prime	PROC
	_Begin
	_PutStr  msg1
	call GetDec
	mov num, ax
	mov savax, ax
	cmp ax,1
	je notprime
	cmp ax,2
	je isprime
	shr ax,1
	jnc notprime
loop1:	dec num
	mov ax,savax
	mov dx, 0
	div num
	cmp dx, 0
	je notprime
	cmp num, 2
	je isprime
	jmp loop1
isprime: _PutStr msg2
	jmp finito
notprime:_PutStr msg3
	jmp finito
finito:	_Exit    0
prime	ENDP
	END prime