====== MAME Debugger Memory Commands ====== ===== dasm ===== **Syntax:** ''dasm ,
,[,[,]]'' The //dasm// command disassembles program memory to the file specified in the '''' parameter. ''
'' indicates the address of the start of disassembly, and '''' indicates how much memory to disassemble. The range ''
'' through ''
+-1'' inclusive will be output to the file. By default, the raw opcode data is output with each line. The optional '''' parameter can be used to enable (''1'') or disable (''0'') this feature. Finally, you can disassemble code from another CPU by specifying the '''' parameter. **Examples:** * ''dasm venture.asm,0,10000'' -- Disassembles addresses ''0-ffff'' in the current CPU, including raw opcode data, to the file ''venture.asm''. * ''dasm harddriv.asm,3000,1000,0,2'' -- Disassembles addresses 3000-3fff from CPU #2, with no raw opcode data, to the file ''harddriv.asm''. ===== find ===== **Syntax:** ''f[ind][{d|i}]
,[,[,...]]'' 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. ''
'' indicates the address to begin searching, and '''' indicates how much memory to search. '''' 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 ''
'' through ''
+-1'' inclusive will be searched for the sequence, and all occurrences will be displayed. **Examples:** * ''find 0,10000,%%"HIGH SCORE"%%,0'' -- Searches the address range ''0-ffff'' in the current CPU for the string ''%%"HIGH SCORE"%%'' followed by a ''0'' byte. * ''findd 3000,1000,w.abcd,4567'' -- Searches the data memory address range ''3000-3fff'' for the word-sized value abcd followed by the word-sized value ''4567''. * ''find 0,8000,%%"AAR"%%,d.0,%%"BEN"%%,w.0'' -- Searches the address range ''0000-7fff'' for the string ''%%"AAR"%%'' followed by a dword-sized ''0'' followed by the string ''%%"BEN"%%'', followed by a word-sized ''0''. ===== dump ===== **Syntax:** ''dump[{d|i}] ,
,[,[,[,]]]'' The //dump/dumpd/dumpi// commands dump memory to the text file specified in the '''' parameter. //dump// will dump program space memory, while //dumpd// will dump data space memory and //dumpi// will dump I/O space memory. ''
'' indicates the address of the start of dumping, and '''' indicates how much memory to dump. The range ''
'' through ''
+-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 '''' parameter, which can be used to group the data in 1, 2, 4 or 8-byte chunks. The optional '''' 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 '''' parameter. **Examples:** * ''dump venture.dmp,0,10000'' -- Dumps addresses ''0-ffff'' in the current CPU in 1-byte chunks, including ASCII data, to the file ''venture.dmp'' * ''dumpd harddriv.dmp,3000,1000,4,0,3'' -- Dumps data memory addresses 3000-3fff from CPU #3 in 4-byte chunks, with no ASCII data, to the file ''harddriv.dmp''. ===== save ===== **Syntax:** ''save[{d|i}] ,
,[,]'' The //save/saved/savei// commands save raw memory to the binary file specified in the '''' parameter. //save// will save program space memory, while //saved// will save data space memory and //savei// will save I/O space memory. ''
'' indicates the address of the start of saving, and '''' indicates how much memory to save. The range ''
'' through ''
+-1'' inclusive will be output to the file. You can also save memory from another CPU by specifying the '''' parameter. **Examples:** * ''save venture.bin,0,10000'' -- Saves addresses ''0-ffff'' in the current CPU to the binary file ''venture.bin''. * ''saved harddriv.bin,3000,1000,3'' -- Saves data memory addresses ''3000-3fff'' from CPU #3 to the binary file ''harddriv.bin''. ===== map ===== **Syntax:** ''map[{d|i}]
'' 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:** * ''map 152d0'' -- Gives physical address and bank for logical address 152d0 in program memory. ===== memdump ===== **Syntax:** ''memdump []'' Dumps the current memory map to ''''. If '''' is omitted, then dumps to ''memdump.log''. **Examples:** * ''memdump mylog.log'' -- Dumps memory to ''mylog.log''. * ''memdump'' -- Dumps memory to ''memdump.log''.