Strings
RAM and flash string operations and integer formatting.
import "lib/string.nbl";
RAM strings are byte strings terminated by 0x00. Addresses are nibble
addresses; each character advances by two. Flash strings are flashptr
values.
str_from_dec16 needs 6 bytes, str_from_dec32 needs 11 bytes,
str_from_hex16 needs 5 bytes, and str_from_hex32 needs 9 bytes. The
str_from_* functions return the digit count and always terminate the buffer.
str_compare returns STR_LT, STR_EQ, or STR_GT.
Constants
Name |
Type |
Value |
|---|---|---|
|
|
|
|
|
|
|
|
|
Functions
Call |
Returns |
Notes |
|---|---|---|
|
|
|
|
|
1 when the strings are identical, including the terminator. |
|
|
|
|
|
|
|
|
Address of the first match, or 0 when absent. RAM variables start at 0x40, so 0 is safe as “not found”. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Trim leading/trailing spaces in place; returns the new string start. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|