; a0 - str1
; a1 - str2
; d0 - length

	xdef	_StrCmpNC

_StrCmpNC	move.l	d2,-(a7)
	subq.l	#1,d0
.loop	move.b	(a1)+,d1
	move.b	(a0)+,d2
	cmp.b	#91,d1
	bgt.s	.ok1
	cmp.b	#65,d1
	blt.s	.ok1
	add.b	#32,d1
.ok1	cmp.b	#91,d2
	bgt.s	.ok2
	cmp.b	#65,d2
	blt.s	.ok2
	add.b	#32,d2
.ok2	cmp.b	d2,d1
	bne.s	.nosame
	tst.b	(-1,a0)
	beq.s	.same
	dbf.s	d0,.loop
.same	moveq	#-1,d0
	bra.s	.finish
.nosame	moveq	#0,d0
.finish	move.l	(a7)+,d2
	rts
