Debug Manual

Table Of Contents
Debug Commands
Debug Manual421921-003
4-48
FN Command
FN Command
The FN command searches memory to find a particular number. The FN command
starts at a specified address and searches memory until one of the following occurs:
A 16-bit word is reached whose contents logically ANDed with mask, and it equals
the result of value logically ANDed with mask.
A 16-bit word address ending in 17 binary zeros is reached.
The form of the FN command is:
address
is the address at which the FN command starts to search memory. The address
parameter must be on an even byte boundary. For more information, see Address
Syntax on page 3-12.
value
is any expression that evaluates to a valid 16-bit number.
mask
is any expression that evaluates to a valid 16-bit number.
Considerations
If you omit value and mask, the FN command uses the value and mask
specified by the previous FN command but starts searching at the newly specified
address.
If you omit address, value, and mask, the FN command uses the value and
mask specified by the previous FN command and starts searching at the address
where the previous FN command terminated.
The FN command has a default that provides a shorthand way of finding repeated
occurrences of a value. If you execute an FN command and a match is found,
Debug responds with the standard prompt followed by (FN). For example:
251,06,024-(FN)-
If you then press RETURN, the effect is the same as entering an FN command
with no parameters; that is, Debug continues searching for the same value starting
at the address where the previous FN command terminated. You can continue
pressing RETURN in this manner until the Debug prompt does not contain (FN)
(indicating that no match was found).
Two possible uses for this command are finding data structures with particular
values and finding code that has moved slightly because of a minor change.
FN [ address [ , value ] [ & mask ] ]