The -find=opcode
option is used to detect and log
occurrences of an opcode or partial code sequence. The usage of this option is:
-find=Findcode [mMask]@Start-End [/Align][w][t”Title”]
where:
Findcode
is the hexadecimal code sequence to
search for. For example, to find a clrf
instruction with the opcode
0x01F1, use 01F1 as the sequence. In the HEX file, this will appear as the byte sequence
F1 01, that is F1 at hex address 0 and 01 at hex address 1.Mask
is optional. It specifies a bit mask
applied over the Findcode
value to allow a less restrictive
search. It is entered in little endian byte order.Start
and
End
limit the address range to search.Align
is optional. It specifies that a code
sequence can only match if it begins on an address that is a multiple of this
value.w
, if present, will cause Hexmate
to issue a warning whenever the code sequence is detected.Title
is optional. It allows a title to be
given to this code sequence. Defining a title will make log-reports and messages more
descriptive and more readable. A title will not affect the actual search results.All numerical arguments are assumed to be hexadecimal values.
Here are some examples.
The option -find=1234@0-7FFF/2w
will detect the code
sequence 1234h when aligned on a 2 (two) byte address boundary, between 0h and 7FFFh. w
indicates that a warning will be issued each time this sequence is found.
In this next example, -find=1234M0F00@0-7FFF/2wt”ADDXY”
,
the option is the same as in last example but the code sequence being matched is masked
with 000Fh, so Hexmate will search for any of the opcodes
123x
h, where x
is any digit. If a
byte-mask is used, is must be of equal byte-width to the opcode it is applied to. Any
messaging or reports generated by Hexmate will refer to this opcode by
the name, ADDXY
, as this was the title defined for this search.
If Hexmate is generating a log file, it will contain
the results of all searches. -find
accepts whole bytes of HEX data from 1
to 8 bytes in length. Optionally, -find
can be used in conjunction with
replace
or delete
(as described below).