10
2.4.4 BS - Block Search
BS
Usage: BS<width> begin end data
The BS command searches a contiguous block of memory starting at address begin, stopping at address
end, for the value data. Width modifies the size of the data that is compared during the search.
The value for addresses begin and end may be an absolute address specified as a hexadecimal value, or a
symbol name. The value for data may be a symbol name, or a number converted according to the user
defined radix, normally hexadecimal.
This command first aligns the starting address for the data access size, and then increments the address
accordingly during the operation. Thus, for the duration of the operation, this command performs properly
aligned memory accesses.
Examples:
To search for the 16-bit value 0x1234 in the memory block starting at 0x00040000 and ending at
0x00080000 the command is:
bs
40000 80000 1234
This reads the 16-bit word located at 0x00040000 and compares it against the 16-bit value 0x1234. If no
match is found, then the address is incremented to 0x00040002 and the next 16-bit value is read and
compared.
To search for the 32-bit value 0xABCD in the memory block starting at 0x00040000 and ending at
0x00080000, the command is:
bs.l
40000 80000 ABCD
This reads the 32-bit word located at 0x00040000 and compares it against the 32-bit value 0x0000ABCD.
If no match is found, then the address is incremented to 0x00040004 and the next 32-bit value is read and
compared.
To search the BSS section (defined by the symbols bss_start and bss_end) for the byte value 0xAA, the
command is:
bs.b
bss_start bss_end AA