*
* string manipulation routines - file 4
*

 name C_str4

 text

* char *strrchr(s, c)
*        char *s;
*        char c;

 global _strrchr
 global _rindex

_rindex
_strrchr ldx 2,s s
 tst 0,x
 bne 2f
 ldd #0
 rts
2 tst 0,x+
 bne 2b
 leax -1,x
 ldb 5,s
4 cmpb 0,-x
 beq 6f
 cmpx 2,s
 bne 4b
 ldd #0
 rts
6 tfr x,d
 rts

 end
