strchr

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: 
AHi_Buffer = bParseBufferCount >> 8
ALo_Buffer = bParseBufferCount & 0xFF

CheckForRange:
   LDI     R25, AHi_Buffer         ; Point to the Command Parsing buffer, which
   LDI     R24, ALo_Buffer         ;  will always have a NULL terminated string
   LDI     R22, '-'                ; Specify the character to find; get the
   CALL    Astrchr                 ;  pointer to the string starting with '-'
   BREQ    ACFR_Return             ; Just exit if no dash was found

   MOVW    R26, R24                ; Save the SRAM pointer returned in R25:R24
   LDI     R25, ACSZ_Found >> 8
   LDI     R24, ACSZ_Found & 0xFF  ; Specify the first string and print it
   CALL    APrintFLASHASCIIz
   MOVW    R24, R26                ; Copy the address and print the rest of the
   CALL    APrintSRAMASCIIz        ;  substring from that point to the NULL
   LDI     R25, ACSZ_At >> 8       ;
   LDI     R24, ACSZ_At & 0xFF     ; Point at the second string to print
   MOVW    R22, R26                ; Set the saved address to print string #2
   LDI     R19, ' '                ; Specify the padding character, print the
   CALL    APrintDescAndHexWORD    ;  second string and hex address; clean up
   CALL    APrintNewLine           ;  with a Carriage Return and Line Feed

CFR_Return:
   RET

CSZ_Found: .STRING "Found \""
CSZ_At:    .STRING "\" at SRAM address"
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