Tools: MPW
Advanced Search
Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

MPW Command Reference




DumpCode resourceFile [-a] [-d] [-di] [-h] [-jt] [-n] [-p]
[-r byte1[,byteN]] [-ri] [-rt type[=ID]] [-s resourceName]


The DumpCode tool disassembles classic 68K and CFM-68K code that is stored in code resources such as 'CODE', 'DRVR', and 'PDEF'. Reading from the resource fork of the specified file, DumpCode writes formatted assembly code to standard output.

By default, this command dumps only 'CODE' resources from a program file; however, you can use the -rt option to dump resources of other types, such as drivers and standalone code.

DumpCode displays 'CODE' resources from applications built for either the classic 68K or CFM-68K runtime environment.


The file specified by resourceFile. DumpCode does not accept standard input.


Standard output. DumpCode writes disassembled code to standard output, displaying the corresponding bytes in hexadecimal and ASCII form. In addition, conventions about executable 'CODE' resources are built into DumpCode and affect the formatted output in special ways:

formats 'CODE' resources with ID 0 as a jump table in unloaded format

displays jump table information stored in the segment header for all other 'CODE' resources

uses a special format at the beginning of 'DRVR' resources


DumpCode can return the following status codes:


no errors


syntax error


fatal error



Specifies the resource file to be disassembled.


Numeric values for options can be specified as decimal constants, or as hexadecimal constants preceded by a $ symbol.


Inhibits adjusting offsets in the output for segment headers. By default, the size of the segment header is subtracted from each offset.


Suppresses the disassembly and dumping of code. Normally DumpCode always disassembles the specified resource file.

This option is useful for generating a small output file displaying just the resource names, sizes, and header information. It is also useful for retrieving specialized information, such as the jump table or data descriptors.


Suppresses display of data initialization information. Normally DumpCode writes data initialization code to standard output.


Suppresses the writing of header information, such as resource-relative locations and hexadecimal and ASCII equivalents. The DumpCode tool normally produces this header information.

This option allows you, for instance, to edit the output and use it as input to the assembler.


Suppresses formatting of the jump table, generating only summary information. Normally DumpCode formats the jump table unless you specify the -jt, -n, -rt, or -s options.


Writes only a list of the resource names found in resourceFile. This option is useful for finding segments or desk accessories by name.


Writes progress information, such as filenames, resource names, IDs, and sizes, to diagnostic output.

-r byte1[,byteN]

Limits the disassembly of code to the range byte1 to byteN. Normally DumpCode disassembles all bytes in a segment. If you omit byteN, the command disassembles the rest of the segment.

This option does not affect disassembly alignment; the disassembly still starts at the base of the resource, but instructions are printed only for the specified range.


Suppresses relocation information in the disassembled code. This option is for use only with MPW's "32-bit everything."

-rt type[=ID]

Disassembles only the single resource of the specified type and numerical ID. If you omit the ID parameter, DumpCode disassembles and dumps all resources of the specified type.

Use this option to specify a type of resource other than 'CODE' or to further limit the resources dumped by specifying an ID.

-s resourceName

Disassembles only the single resource named resourceName.


The following command line disassembles the 'CODE' resources in the file Sample by writing the output to the file Sample.Dump.

DumpCode Sample > Sample.Dump

The output has this format:

File: sample, Resource 3, Type: CODE, Name: _DataInit
Offset of first jump table entry: $00000018
Segment is $000000D2 bytes long, and uses 1 jump table entry
000000: 48E7 FFF0     'H...'     MOVEM.L    D0-D7/A0-A3,-(A7)
000004: 4247          'BG'       CLR.W      D7
000006: 4EAD 0032     'N..2'     JSR        $0032(A5)
00000A: 2218          '".'       MOVE.L     (A0)+,D1


DumpCode cannot display the entire jump table for a CFM-68K application. The jump table for these applications is stored within the PEF container, which DumpCode cannot read.








The Segment Manager chapter of Inside Macintosh: Processes.


Last Updated July 2000

Get information on Apple products.
Visit the Apple Store online or at retail locations.

Copyright © 2004 Apple Computer, Inc.
All rights reserved. | Terms of use | Privacy Notice