	openlib=-408
	output=-60
	write=-48
	clr.l	d3
	subq.b	#1,d0
	beq.l	noinput
	cmp.b	#8,d0
	bhi.l	toolong
	cmp.b	#36,(a0)+
	beq.s	hex
dec:	move.l	#1,d2
loop1:	clr.l	d1
	move.b	-2(a0,d0.b),d1
	sub.b	#48,d1
	beq.s	x10
	cmp.b	#9,d1	
	bhi.l	notnr
d1xd2:	add.l	d2,d3
	subq.b	#1,d1
	bne.s	d1xd2
x10:	move.l	#9,d4
count:	add.l	d2,d1
	dbf	d4,count
	exg	d1,d2
	subq.b	#1,d0
	bne.s	loop1
	cmp.l	#16777215,d3
	bhi.s	outrng
dojump:	btst	#0,d3
	bne.s	noeven
	move.l	d3,adress+2
adress:	jmp	$000000
hex:	cmp.b	#8,d0
	beq.s	outrng
	subq.b	#1,d0
	beq.s	noinput
loop2:	move.b	(a0)+,d1
	sub.b	#87,d1
	bpl.s	donext
	add.b	#39,d1
donext:	cmp.b	#15,d1
	bhi.s	notnr
	or.b	d1,d3
	subq.b	#1,d0
	beq.s	dojump
	asl.l	#4,d3
	bra.s	loop2
noinput:bsr	settxt
	move.l	#txt,d2
	move.l	#18,d3
	bra.s	end
toolong:bsr	settxt
	move.l	#txt+13,d2
	move.l	#14,d3
	bra.s	end
outrng:	bsr	settxt
	move.l	#txt2,d2
	move.l	#12,d3
	bra.s	end
notnr:	bsr	settxt
	move.l	#txt3,d2
	move.l	#20,d3
	bra.s	end
noeven:	bsr	settxt
	move.l	#txt3+14,d2
	move.l	#15,d3
end:	jsr	write(a6)
	move.l	dest,d1
	move.l	#point,d2
	moveq	#2,d3
	jsr	write(a6)
	clr.l	d0
	rts
settxt:	move.l	$4,a6
	lea	dos,a1
	jsr	openlib(a6)
	exg	d0,a6
	jsr	output(a6)
	move.l	d0,dest
	exg	d0,d1
	rts
dos:	dc.b	"dos.library",0
dest:	dc.l	0
point:	dc.b	46,10
TXT:	DC.B	"WHERE IS THE INPUT TOO LONG"
TXT2:	DC.B	"OUT OF RANGE"
TXT3:	DC.B	"NOT A HEX/DEC NUMBER NOT EVEN"
