PDP11DASM User Manual

Copyright 2004 by Jeffery L. Post
theposts AT pacbell DOT net
Version 0.0.3 - January, 2004

### TABLE OF CONTENTS

- Introduction
- Using pdp11dasm
- Disclaimer

Introduction

Pdp11dasm is a Linux disassembler for PDP-11 binary code. The C source code for PDP11DASM is released under the GNU General Public License (see the file COPYING). Type 'make' and then copy the compiled pdp11dasm to '/usr/local/bin' or whatever directory is part of your path.
Using pdp11dasm

Type 'pdp11dasm <filename>' to disassemble a PDP-11 binary file. Pdp11dasm will write the output disassembly code to a file of the same name but with an extention of '.das' appended.
The output of pdp11dasm consists of five fields:

- Address field - Address of each instruction in octal.
- Opcode field - One to three instruction words in octal.
- Mnemonic field - The PDP-11 assembly mnemonic for the instruction.
- Operand field - Symbolic representation of any instruction operands.
- Comment field - Ascii representation of the instruction and operand words.

Example (columns may not line up in your browser):

    ;
    000604: 005767 041066       	tst	41676			; w.6B
    000610: 001403              	beq	620			; ..
    000612: 020427 000012       	cmp	r4,#12			; .!..
    000616: 001022              	bne	664			; ..
    000620: 010477 017446       	mov	r4,@20272		; ?.&.
    000624: 062767 000002 017440	add	#2,20272		; we.. .
    000632: 026727 017434 041652	cmp	20272,#41652		; W-..*C
    000640: 103411              	bcs	664			; ..
    000642: 012767 040652 017422	mov	#40652,20272		; w.*A..
    000650: 116700 037774       	movb	40650,r0		; @.|?
    000654: 104404              	trap	4			; ..
    000656: 040652              	bic	r6,@-(r2)		; *A
    000660: 001000              	bne	662			; ..
    000662: 103636              	bcs	360			; ..
    000664: 000207              	rts	r7			; ..
    ;

Of course, pdp11dasm has no way of knowing whether the binary words it's disassembling are really code, or if they're data. When the words are actually data, it would be nice if the disassembler would output a more meaningful listing, such as:

    005512: 170360 170360 175056	defw	170360,170360,175056	; pppp.z
    005520: 030460 031462 032464	defb	'012345'		; 012345
    005526: 033466 034470       	defb	'6789'			; 6789
    005532: 177360 170000 172364	defw	177360,170000,172364	; p~.ptt

You can have pdp11dasm do just that by creating a text file with the same name as the file to be disassembled, but with an extention of '.ctl'. In this control file, you can specify regions as binary words or ascii text by entering a 'd' for data, or 'a' for ascii followed by the address (in octal). If more than one word should be flagged as the given type, you can do it in one of two ways:
After the address, put a dash followed by the ending address:

    d 5512-5516
    a 5520-5530
    d 5532-5536

Or put a plus followed by the size of the region in bytes (in octal):

    d 5512+6
    a 5520+12
    d 5532+6

The size number is entered in octal bytes instead of words to simplify calculating the size from the start and end addresses. For example: the first line in the above example has binary words at 5512, but switches to ascii text at 5520. In octal, 5520 - 5512 = 6, so the size of the binary region is 6 bytes. The ascii region starts at 5520 and changes back to binary words at 5532. 5532 - 5520 = 12 (octal) bytes.
Note that three words at most will be on each line of output regardless of the length of the region. This is so that the opcode field will show at most three words, and to prevent really long strings in the program from making excessively long lines in the output file.
Each line in the control file must start with either a 'd' or an 'a'. Any other character in the first column will cause that line to be interpreted as a comment and otherwise ignored.
When pdp11dasm is run, it will look for a control file with the same name as the file given on the command line. You only need to create a control file in the same directory as the file to be disassembled for it to be used in the disassembly process.
Disclaimer

Pdp11dasm is a tool for educational use and for recovering source code that has been lost or is unavailable. Disassembling a program may be unethical or illegal under some circumstances. It is your sole responsibility to determine if use of pdp11dasm is appropriate for your circumstances.
Back to top