include	clib.inc
include	string.inc

_TEXT	SEGMENT

strrchr proc dist pascal public uses di s1:dword, char:word
	les di,s1
	xor ax,ax
	cwd
	cld
	mov cx,-1
	repne scasb
	not cx
	dec di
	std
	mov al,byte ptr char
	repne scasb
	mov al,0
	jne @F
	mov dx,word ptr S1+2
	mov ax,di
	inc ax
      @@:
	test ax,ax
	ret
strrchr endp

_TEXT	ENDS

	END
