*
* Subroutine to check for existance of cookie.  Pass cookie name in
* D7.  If cookie not found, D7 returns NULL else retains name of cookie
* sought.  If cookie found, cookie contents are returned in D6.
*
*
* Mike Allen
* Las Cruces, NM
* 12/2/92
*
	SECTION TEXT
JAR	EQU	$5a0

cookie:	pea	cook
	move.w	#$26,-(sp)
	trap	#14
	addq.l	#6,sp
	move.l	cookd6,d6		update d6 and d7
	move.l	cookd7,d7
	rts

cook:	move.l	#0,cookd7
	movea.l	(JAR).l,a0		get the contents of the jar
	cmpa.l	#0,a0
	beq	cooked			no jar!
ck_jar:	cmpi.l	#0,(a0)			null cookie?
	beq	cooked			yep	
	cmp.l	(a0)+,d7		look for cookie
	beq	ck_dat			ok, got the cookie
	addq.l	#4,a0
	bra.s	ck_jar			look at next cookie
ck_dat:	move.l	d7,cookd7		cookie name in d7
	move.l	(a0),cookd6		return cookie in d6
cooked:	rts

	SECTION BSS
cookd6:	ds.l	1
cookd7:	ds.l	1

