Table of Contents

MAME Debugger Memory Commands

dasm

Syntax: dasm <filename>,<address>,<length>[,<opcodes>[,<cpunum>]]

The dasm command disassembles program memory to the file specified in the <filename> parameter. <address> indicates the address of the start of disassembly, and <length> indicates how much memory to disassemble. The range <address> through <address>+<length>-1 inclusive will be output to the file. By default, the raw opcode data is output with each line. The optional <opcodes> parameter can be used to enable (1) or disable (0) this feature. Finally, you can disassemble code from another CPU by specifying the <cpunum> parameter.

Examples:

find

Syntax: f[ind][{d|i}] <address>,<length>[,<data>[,…]]

The find/findd/findi commands search through memory for the specified sequence of data. find will search program space memory, while findd will search data space memory and findi will search I/O space memory. <address> indicates the address to begin searching, and <length> indicates how much memory to search. <data> can either be a quoted string or a numeric value or expression or the wildcard character ?. Strings by default imply a byte-sized search; non-string data is searched by default in the native word size of the CPU. To override the search size for non-strings, you can prefix the value with b. to force byte-sized search, w. for word-sized search, d. for dword-sized, and q. for qword-sized. Overrides are remembered, so if you want to search for a series of words, you need only to prefix the first value with a w.. Note also that you can intermix sizes in order to perform more complex searches. The entire range <address> through <address>+<length>-1 inclusive will be searched for the sequence, and all occurrences will be displayed.

Examples:

dump

Syntax: dump[{d|i}] <filename>,<address>,<length>[,<size>[,<ascii>[,<cpunum>]]]

The dump/dumpd/dumpi commands dump memory to the text file specified in the <filename> parameter. dump will dump program space memory, while dumpd will dump data space memory and dumpi will dump I/O space memory. <address> indicates the address of the start of dumping, and <length> indicates how much memory to dump. The range <address> through <address>+<length>-1 inclusive will be output to the file. By default, the data will be output in byte format, unless the underlying address space is word/dword/qword-only. You can override this by specifying the <size> parameter, which can be used to group the data in 1, 2, 4 or 8-byte chunks. The optional <ascii> parameter can be used to enable (1) or disable (0) the output of ASCII characters to the right of each line; by default, this is enabled. Finally, you can dump memory from another CPU by specifying the <cpunum> parameter.

Examples:

save

Syntax: save[{d|i}] <filename>,<address>,<length>[,<cpunum>]

The save/saved/savei commands save raw memory to the binary file specified in the <filename> parameter. save will save program space memory, while saved will save data space memory and savei will save I/O space memory. <address> indicates the address of the start of saving, and <length> indicates how much memory to save. The range <address> through <address>+<length>-1 inclusive will be output to the file. You can also save memory from another CPU by specifying the <cpunum> parameter.

Examples:

map

Syntax: map[{d|i}] <address>

The map/mapd/mapi commands map a logical address in memory to the correct physical address, as well as specifying the bank. map will map program space memory, while mapd will map data space memory and mapi will map I/O space memory.

Examples:

memdump

Syntax: memdump [<filename>]

Dumps the current memory map to <filename>. If <filename> is omitted, then dumps to memdump.log.

Examples: