• Please review our updated Terms and Rules here

PDP-11 disassembler for Windows?

saipan59

Experienced Member
Joined
Dec 27, 2010
Messages
264
Location
Colorado Springs
I suppose this type of question has been asked a lot, but Google is not helping me...
I'm looking for a simple, basic, PDP-11 disassembler that runs under Windows. In a CMD window would be fine.
I found "PDP11GUI", but it has lots of baggage that I don't want, plus it seems to want a 'connection' to a real or simulated PDP. I just want to paste an octal dump into something...

Thanks!
Pete
 
I believe Simh can do that but you'd have to install it. It's not hard to use but at first can be a bit
confusing.
 
If you just want to poke a few values into some program as PDP-11 binary code and then display as disassembled code, SIMH can easily do that.
You can get prebuilt binaries from SIMH on github; here is a link to the latest:
https://github.com/simh/Win32-Devel...ies/simh-4.0-Current--2019-07-30-354a1e42.zip
It is 40MB and has all the SIMH simulator executables zipped up. Just extract PDP11.EXE and discard the rest (unless you want them of course).
 
Although I have it installed and have loaded a disk image or two I've not used simh much for anything and would be interested in the steps needed to get a file from Windows onto say an RT-11 image and the commands to disassemble.

In the meantime, I found this little PDP-11 disassembler on Github:
https://github.com/caldwell/pdp11dasm

There was no Windows binary included there so I chucked the single source file (amazingly, no header) specifically into an old version of Visual Studio (2008 ) so I could get a plain old Win32 exe, and it compiled without any errors right off the bat which is unusual for a lot of C/C++ code being ported to Windows. It's only 53Kb in size.

Code:
Directory of c:\Users\Steven\Documents\Visual Studio 2008\Projects\winpdp11dasm\Debug

02/08/2019  09:00 AM    <DIR>          .
02/08/2019  09:00 AM    <DIR>          ..
02/08/2019  09:00 AM           152,742 BuildLog.htm
. . .
02/08/2019  09:00 AM            53,760 winpdp11dasm.exe
. . .

c:\Users\Steven\Documents\Visual Studio 2008\Projects\winpdp11dasm\Debug>winpdp11dasm -help

usage: pdp11dasm [options] file

'file' is the PDP-11 binary file to disassemble.
Output will be written to 'file.das'.
Options:
  -v --version   Show version and exit.
  -h --help      Display this message and exit.


c:\Users\Steven\Documents\Visual Studio 2008\Projects\winpdp11dasm\Debug>winpdp11dasm -v

pdp11dasm version 0.0.3


c:\Users\Steven\Documents\Visual Studio 2008\Projects\winpdp11dasm\Debug>

So that's all I've done, no further testing, no guarantee on anything but I suppose it works. If you want the exe (or the whole VS2008 solution, it's not very big) let me know.

Actually I thought I'd just zip the whole thing and put it up at http://web.aanet.com.au/~malikoff/pdp11/winpdp11dasm.zip let me know if it works as advertised.
 
Last edited:
PDP11DASM from Github:
Your EXE build wouldn't run on my box, apparently because of the old version of V-Studio that you used. I re-built it under Vis Studio 2015, and it now runs.
The downside is that it wants a *binary* input file. My need is to disassemble octal-ASCII dumped via ODT. I suppose I can make a little VC++ app to convert octal-ASCII to binary... Or modify the DASM app to process my octal-ASCII...

Pete
 
Righto. I can recompile in all versions of VS up to and including VS2019 if wanted. Modifying the source to take octal ASCII sounds like it would be a useful addition to that program.
 
PDP11DASM from Github:
Your EXE build wouldn't run on my box, apparently because of the old version of V-Studio that you used. I re-built it under Vis Studio 2015, and it now runs.
The downside is that it wants a *binary* input file. My need is to disassemble octal-ASCII dumped via ODT. I suppose I can make a little VC++ app to convert octal-ASCII to binary... Or modify the DASM app to process my octal-ASCII...

Pete

With SIMH you can load BIN (binary) format images and then use the disassembler. Or just poke octal values into memory and disassemble.
 
PDP11DASM has issues.
I wrote an app to feed it binary data, converted from my TXT file. The DASM does maybe 20 or so opcode lines, then the output quits - it just outputs comment lines, with no error indication, etc. In the example below, also not the branch offset of "37777777764".
I'm not interested in debugging it, so I'll try SIMH next.

;
; pdp11dasm version 0.0.3
; disassembly of odt.bin
;
000000: 006100 rol r0 ; @.
000002: 006100 rol r0 ; @.
000004: 006100 rol r0 ; @.
000006: 004567 000114 jsr r5,126 ; w.L.
000012: 000764 br 37777777764 ; t.
;
000014: 012700 000340 mov #340,r0 ; @.`.
000020: 106400 invalid opcode ; ..
000022: 000005 reset ; ..
000024: 012701 176500 mov #176500,r1 ; A.@}
000030: 012706 004000 mov #4000,r6 ; F...
000034: 012702 176504 mov #176504,r2 ; B.D}
000040: 010100 mov r1,r0 ; @.
000042: 005212 inc (r2) ; ..
000044: 105712 tstb (r2) ; J.
000046: 100376 ; ~.
000050: 006300 ; @.
000052: 001005 ; ..
000054: 005012 ; ..
000056: 012700 ; @.
000060: 000004 ; ..

Pete
 
Using SIMH:
Code:
DEC[503] pdp11

PDP-11 simulator V4.0-0 Current        git commit id: 0b9cfa9b

sim> de 000000 006100
sim> de 000002 006100
sim> de 000004 006100
sim> de 000006 004567
sim> de 000010 000114
sim> de 000012 000764
sim> de 000014 012700
sim> de 000016 000340
sim> de 000020 106400
sim> de 000022 000005
sim> de 000024 012701
sim> de 000026 176500
sim> de 000030 012706
sim> de 000032 004000
sim> de 000034 012702
sim> de 000036 176504
sim> de 000040 010100
sim> de 000042 005212
sim> de 000044 105712
sim> de 000046 100376
sim> de 000050 006300
sim> de 000052 001005
sim> de 000054 005012
sim> de 000056 012700
sim> de 000060 000004
sim>
sim> ex 0-60
0:      006100
2:      006100
4:      006100
6:      004567
10:     000114
12:     000764
14:     012700
16:     000340
20:     106400
22:     000005
24:     012701
26:     176500
30:     012706
32:     004000
34:     012702
36:     176504
40:     010100
42:     005212
44:     105712
46:     100376
50:     006300
52:     001005
54:     005012
56:     012700
60:     000004
sim> ex -m 0-60
0:      ROL R0
2:      ROL R0
4:      ROL R0
6:      JSR R5,126
12:     BR 177764
14:     MOV #340,R0
20:     MTPS R0
22:     RESET
24:     MOV #176500,R1
30:     MOV #4000,SP
34:     MOV #176504,R2
40:     MOV R1,R0
42:     INC (R2)
44:     TSTB (R2)
46:     BPL 44
50:     ASL R0
52:     BNE 66
54:     CLR (R2)
56:     MOV #4,R0
sim>
 
The strange branch instruction is a result of compiling a 16-bit application with a 32-bit compiler - and getting a sign extension. I assume the original code for PDP11DASM was written years ago when 16-bit integers were the norm? You may still be able to 'force' your compiler to compile it in 16-bit mode with a switch?

The invalid opcode is the MTPS which is an instruction that is not present on every PDP11 machine. You have to ask yourself "which version of PDP11 CPU was PDP11DASM targetted for" and "are there any switches to change the type of CPU it thinks is present"?

The missing instructions at the end may be a bug.

I can have a look at the source code when I get home (I can't do it from work).

I find just having a very simple disassembler is very useful - and it is usually the task I set myself when learning a new processor instruction set. When I went on the DEC MACRO11 course many (many) years ago, I wrote a disassembler for the PDP11 as a lab excercise. I still have the RX33 disk somewhere. Not sure whether it is still readable though...

Dave
 
Update: SIMH is working fine for my purposes. Will educate myself on the various features/options.
Thanks everyone!

I did a dump of the ROM in an MXV11 (which is supposedly a TU58 boot).

Pete
 
Update: SIMH is working fine for my purposes. Will educate myself on the various features/options.
Thanks everyone!

I did a dump of the ROM in an MXV11 (which is supposedly a TU58 boot).

Pete

As a 'side' benefit of using SIMH it can also run the code you plug into it, if you so choose.
Single step, display processor state, etc are also available.
 
PDP11DASM from Github:
Your EXE build wouldn't run on my box, apparently because of the old version of V-Studio that you used. I re-built it under Vis Studio 2015, and it now runs.
The downside is that it wants a *binary* input file. My need is to disassemble octal-ASCII dumped via ODT. I suppose I can make a little VC++ app to convert octal-ASCII to binary... Or modify the DASM app to process my octal-ASCII...

Pete
I've needed to do that on occasion - thousands of lines dumped by ODT, but all of my disassembly tools wanted binary files as input. I just wrote an EDT macro to convert the file with the ODT info
address/value
pairs into
address: .word value

lines - then assembled the resulting file, at which point I could disassmble the resulting .obj binary file.
 
Back
Top