	extrn	multicast_count: word
	extrn	multicast_broad: byte

multicast_filter:
;enter with es:di -> packet destination address.
;exit with nc if we should receive it, cy if not.
	test	byte ptr es:[di],1	;is this a multicast address?
	je	multicast_filter_ok	;no - must be okay to receive.

	mov	si,offset multicast_broad
	mov	dx,multicast_count
	inc	dx			;include the broadcast address.

multicast_filter_1:
	mov	cx,EADDR_LEN/2		;compare one address.
	repe	cmpsw
	je	multicast_filter_ok	;They match - ok to receive.
	add	di,cx			;bump di to the next address.
	dec	dx
	jne	multicast_filter_1
	stc
	ret
multicast_filter_ok:
	clc
	ret
