8.2.3.24 String Hexmate Option
The
-string
option will embed into the HEX file an ASCII
string at a fixed address. The usage of this option
is:-string@Address[tCode]="Text"
where:Address
is assumed to be a hexadecimal value representing the address at which the string will be stored. Its interpretation is based on the addressing value (see 8.2.3.10 Addressing Hexmate Option).Code
is optional and allows a byte sequence to trail each byte in the string. This can allow the bytes of the string to be encoded within an instruction, for example.Text
is the string to convert to ASCII and embed.
Note that this option inserts data into the output HEX file, thus, to prevent a conflict, you must ensure that the locations where this data is to be placed are not already populated by other data from a HEX file or from another option.
For
example:
-string@1000="My favorite string"
will store
the ASCII data for the string, My favorite string (including the null character
terminator), at address 0x1000, assuming an addressing value of 1.And
again:
-string@1000t34="My favorite string"
will
store the same string, trailing every byte in the string with the HEX code 0x34, which
would encapsulate the bytes into a retlw
instruction if targeting a
Mid-range PIC device, for example.