| Purpose: | Search a small SRAM buffer for the first ASCII character which represents a numeric digit. | ||||
| Assumes: | The buffer is limited to 255 bytes. | ||||
| Passed: | R25:R24 | CHAR * | szPtrBuffer | address of the SRAM buffer to examine | |
| R22 | BYTE | bMaxCount | maximum number of BYTEs to check | ||
| Returns: | R25:R24 | CHAR * | szPtrFirstNum | pointer to the first ASCII '0' through '9' found within the range OR a NULL pointer (0x0000) if none of those ASCII digits were found in the range |
|
| Alters: | R26, R27, and the FLAGs | ||||
| Example: |
|
|||
| Test it: |
| |||
| Notes: | The search is for any of the characters '0' (= ASCII 0x30 = 48) through '9' (= ASCII 0x39 = 57). | |||
| Although the usual string terminator is a BYTE of 0, this routine does not check for it, but will examine up to the limit specified. | ||||
| The strlen System Function could be used to determine the number of bytes in the string to pass as bMaxCount. | ||||
| Dropin: (setup code) |
; Setup for the FindFirstNumericDigit() call: ; Passed: R25:R24 CHAR * szPtrBuffer pointer to the start of the SRAM buffer ; R22 BYTE bMaxCount maximum number of BYTEs to search ; Returns: R25:R24 CHAR * szPtrFirst pointer to the first numeric ASCII BYTE ; this will be a NULL if none are found ; Alters: R26, R27, and the FLAGs |
|||
| Also see: | The parsing and PrintSRAMASCIIz System Functions. | |||