; zero terminated string compare  ignore case ( a = A)

			public	strcmpi
strcmpi_asm	segment	'code'
			assume	cs:strcmpi_asm

strcmpi		proc	far

s1			equ		dword ptr [bp+0ah]
s2			equ		dword ptr [bp+06h]

			push	bp
			mov		bp,sp
			push	si
			push	di
			push	ds
			cld
			lds		si,s1
			les		di,s2
cmploop:
			lodsb
			cmp		al,'a'
			jl		tu_done
			cmp		al,'z'
			jg		tu_done
			sub		al,'a''A'
tu_done:
			mov		ah,es:byte ptr [di]
			inc		di
			cmp		ah,'a'
			jl		tu_done1
			cmp		ah,'z'
			jg		tu_done1
			sub		ah,'a''A'
tu_done1:
			cmp		al,ah
			jne		notequal
			test	al,al
			jnz		cmploop
			sub		ax,ax
			jmp		done
notequal:
			mov		ax,0
			jb		less
			inc		ax
			jmp		done
less:
			dec		ax
done:
			pop		ds
			pop		di
			pop		si
			pop		bp
			ret		08h

strcmpi		endp
strcmpi_asm	ends
			end
PjpmyoPz}P @	@pp@_0 O	@P 