include	clib.inc
include	string.inc

SEPERATOR equ 	' '

PPROC	cmpwargs, filep:dword, maskp:dword
	push	si
	push	di
	mov	si,word ptr maskp+2
	mov	di,word ptr maskp
    cmpwargs_loop:
	invoke	strchr, si::di, SEPERATOR
	jz	cmpwargs_02
	xchg	di,ax
	mov	byte ptr es:[di],0
	invoke	cmpwarg, filep, si::ax
	mov	byte ptr es:[di],SEPERATOR
	inc	di
	test	ax,ax
	jz	cmpwargs_loop
    cmpwargs_end:
	pop	di
	pop	si
	ret
    cmpwargs_02:
	invoke	cmpwarg, filep, si::di
	jmp	cmpwargs_end
PEND	cmpwargs

	END
