Disassembler for MIPS Processors

Have fun!


usage: disasmips [option]* {file}		# system / version date

    input control options:

	-m {file}	mapfile, symbolic addresses may be used after -m
	-o {addr}	offset, memory address of 1st byte in dump file
	-a {addr}	start address (hex or symbol)
	-e {addr}	end address (hex or symbol), not before -a
	-s {size}	size (hex), instead of end address
	-n {lines}	maximum number of output lines
	-h {dir}	HTML output directory, use -n for approx. file size
	-x		end at address of next symbol after start address

	-LE		force as Little Endian input
	-NO		not an object file
	-NG		no GPA in object file ($gp/$s7 global pointer area)
	-GP {addr}	global offset table address for offset($gp) terms

    presentation options:

	-g		GCC register naming
	-b		prefix braces before symbol labels
	-r		show addresses relative to last symbol label
	-c		special comments for some instruction[ sequence]s
	-B {len}	bi-instruction memory access sequence length
			(#instructions: 1=off, 2..50, default=10), implies -c
	-F {len}	function end extension by branches < len to next JR
			(#instructions: 1=off, 2..10000, default=500)
	-H		highlight jumps/branches and load/store (HTML output)
	-S		short operands format (sub $1,$2; BUT sub $1,$2,$1)
	-P		pseudo moves (move $1,$2; move $a0,100), implies -S
	-A		all of the above presentation options

    other options:

	-t		test only (coverage and inambiguity of decoded ops)
	-!		show mapfile syntax

mapfile syntax: [[value [@|*]symbol] [comment] [#comment] newline]*

	value  := {hexnum | symbol}[+{value}]
	hexnum := [0x]{0..9 | a..f | A..F}*
	symbol := {a..z | A..Z | _ | 0..9}*

	symbols must not start with a decimal digit
	symbols must not be identical to any hex number

	special symbol '//' indicates a commented only value
	special comment '// $gp={value}' sets $gp for offset($gp) terms

	prefixed '@' switches from code to data representation
	'symbol' / '@symbol' / '*symbol' are different symbols

	for addr references in options, '@' may be omitted, but then, an
		existing 'symbol' is taken before the '@symbol'

	comments before a # sign are visible in generated output
	multiple mapfiles (-m options) allowed


Example Output:

	00000034:    18800006	blez	$a0,0x50
	00000038:    24020001	addiu	$v0,$zero,1
	0000003c:    00440018	mult	$v0,$a0
	00000040:    2484ffff	addiu	$a0,$a0,-1
	00000044:    00001012	mflo	$v0
	00000048:    1c80fffc	bgtz	$a0,0x3c
	0000004c:    00000000	nop
	00000050:    03e00008	jr	$ra
	00000054:    00000000	nop

(Compiled from

	int fac (int i) {int k = 1; while (i > 0) k *= i--; return (k);}

by GCC.)


Versions / Modification History:

		new option -GP: global offset table address for offset($gp) terms
		new option -NG: no GPA in object file ($gp/$s7 global pointer area)
		significantly improved performance for very large symbol maps
		comments' pointer chaining: stop at function heads improved
		new option -LE: little-endian support
		new option -NO: not an object file
		new option -F: detection of function boundaries improved
		detection of non-influencing instructions for -B improved
		maximum line length of mapfiles increased to 200 characters
		bugfix: crash on WinXP in some cases
		disassembly of GCC object files now possible
			(with automatic map and global offset table relocation)
		decoding of memory references of type lw + nop + addiu
		special comment "// $s7=value" for use in "offset($s7)" terms
		minimum string length set to 2 (was 1)
		new option -A for all must-have presentation options
		first release for Linux (x86)
		new option -S: output only 2 operands, if $dst == $src1..2
		new option -P: output mnemonic "move" on appropriate cases
		special comment "// $gp=value" also for "addiu ..,$gp,.." instr.
		detection of non-influencing instructions for -B improved
		highlight jumps/branches and load/store (new option -H)
		align all comments correctly
		bugfix: too relaxed non-influencing instructions for -B
		bi-instruction memory references may be separated by up to 48
			non-influencing instructions (new option -B)
		bi-instruction memory references may be separated by another
			non-influencing instruction
		bugfix: cyclic memory references
		complete decoding of bi-instruction memory references of type
			lui + addi / ori / load / store
		bugfix: ambiguity test (mtc0 was not ambiguous to cop0)
 		bugfix: mtc0/mfc0 (rd confused with rt)
		new mtc0/mfc0 format Rrd[.sel]#regname
		symbols.htm with links to all HTML files now
		calls.htm with up to 500 entries now
		string references accept \t, \r and \n now (converted to blanks)
		relative addresses for symbol definitions in mapfiles
		special symbol "//" in mapfiles to indicate instruction comment
		special comment "// $gp=value" for use in "offset($gp)" terms
		decoding of mtc0, mfc0 and cache
		calls.htm for statistics
		HTML output possible
		absolute branch addresses possibly shown as symbols
		string references
		symbol maps
		first release for Win32



You are free to use this program for non-commercial purposes.

Acade disclaims all warranties as to this software, whether express
or implied, including without limitation any implied warranties of mer-
chantability, fitness for a particular purpose or functionality.

Any responsibility for any damages (including consequential ones)
caused directly or by reliance on this program is denied.

Using this program is an acknowledgement of these conditions.


Any trademarks mentioned are property of their respective owners.