| Purpose: | Find the first occurrence of a specific character in an SRAM ASCIIz string buffer. |
| Assumes: | The string is NULL terminated (first 0x00 character ends the string) |
| Passed: | R25:R24 | BYTE * | szBuffer | pointer to the buffer to examine | |||
| R22 | CHAR | cFind | character to find in the SRAM buffer | ||||
| Returns: | R25:R24 | BYTE * | bPtrAddress | pointer to the character in the buffer or NULL | |||
| FLAGS | ZERO | flag | set (TRUE) when NOT found (and R25:R24 = 0) clear (FALSE) when found (and R25:R24 > 0) |
||||
| Alters: | Only R24, R25, and FLAGS |
| Example: |
|
| Notes: | Either the character specified or NULL byte ends the search. If the byte with value 0 ends the search, R25:R24 will return = 0 (i.e., a NULL pointer.) |
| Dropin: (setup code) |
; Setup for the strchr() call: ; Passed: R25:R24 BYTE * szPtrBuffer pointer to buffer to examine ; R22 CHAR cFind character to find first occurrence ; Returns: R25:R24 BYTE * bPtrAddress pointer to that character or NULL ; (Also): ZERO FLAG TRUE if NOT found (R25:R24 = NULL), ; FALSE if found (R25:R24 is nonzero) ; Alters: Only R24, R25 and the FLAGS are changed |
| Also see: | strcpy, strlen |