.model tiny
.code
.486
	org	100h
start:
	pushf
	pop	ax
	and	ax,0fffh
	push	ax
	popf
	pushf
	pop	ax
	and	ax,0f000h
	cmp	ax,0f000h
	jne	cpu1
	mov	ah,9
	mov	dx,offset _0086
	int	21h
	int	20h
cpu1:	or	ax,0f000h
	push	ax
	popf
	pushf
	pop	ax
	and	ax,0f000h
	jnz	cpu2
	mov	ah,9
	mov	dx,offset _0286
	int	21h
	int	20h
cpu2:	mov	bx,sp
	and	sp,not 3
	pushfd
	pop	eax
	mov	ecx,eax
	xor	eax,40000h
	push	eax
	popfd
	pushfd
	pop	eax
	mov	sp,bx
	jnz	cpu3
	mov	ah,9
	mov	dx,offset _0386
	int	21h
	int	20h
cpu3:		
	mov	ah,9
	mov	dx,offset _0486
	int	21h
	int	20h
	db	13,10
_0086	db	'CPU - i8086 or i8088',13,10,'$'
_0286	db	'CPU - i80286',13,10,'$'
_0386	db	'CPU - i80386SX or i80386DX',13,10,'$'
_0486	db	'CPU - i80486SX or i80486DX',13,10,'$'
end	start 