PDP11 Coding - with SIMH, and some Linux tools
If you want to write code for a PDP11 CPU or PDP11 machine, you need some environment to do so. I have only parts of a PDP11 machine and cannot simply use this to write code. So I tried several ways:
- Using SIMH emulator to emulate a PDP11 machine, boot up some PDP11 Operating System (RT11) and use the available tools from that OS
- Using native Linux executables that allow for assemble and link valid PDP11 executables
- Using Gnu GCC toolchain for bare metal programming
The SIMH emulator way is described in this document further below. The two other paths are described in additional documents.
Using Linux tools to create, assemble and link PDP11 files
See assembler.html for further information
Using Gnu GCC toolchain for bare metal programming
See this document for further information
Using SIMH Emulator (and PDPs RT11 operating system) to create, assemble and link PDP11 files
Build SIMH
Get SIMH from https://github.com/simh/simh.
Build only PDP incarnations, search for ALL
target in makefile and comment
all unneeded emulator incarnations.
Then start build with make
. Executables are created in directory BIN
.
Set up an emulation that boots RT-11 operating system
To execute the MACRO-11 macro assembler from DEC, the operating system RT-11 can be used as base.
Install RT-11 as described here: http://decuser.blogspot.com/2015/12/tutorial-setting-up-rt-11-v53-on-simh.html The page has a link to an old RT-11 image and also the same can be found here http://simh.trailing-edge.com/software.html.
If you become confused with the strange editor “EDIT”, there is some help in this file https://fjkraan.home.xs4all.nl/comp/miniminc/rt11_edit.txt
Try coding
After following the steps described in the blogpost-Link, the simulation can be started with:
pdp11 boot.ini
My boot.ini has the content:
set cpu 11/23+ 256K
set tto 8b
attach LPT lpt.txt
set rl0 writeenabled
set rl0 rl02
attach rl0 RT-11_V5.3_BIN_RL02_WORKING
set rl1 writeenabled
set rl1 rl02
attach rl1 storage.dsk
set rl1 badblock
boot rl0
The decuser link mentioned has a nice hello world test to do the edit, assemble, link, run cycle for the first time Their hello world;
.TYPE HELLO.MAC
.TITLE HELLO
.MCALL .PRINT,.EXIT ; TELL ASSEMBLER I WANT THESE TWO FROM SYSMAC.SML
START: .PRINT #HELLO ; CALL OS FUNCTION TO PRINT STRING, ADDRESS HELLO
.EXIT ; CALL OS FUNCTION TO TERMINATE THE PROGRAM
HELLO: .ASCIZ /HELLO, WORLD/ ; AN ASCII STRING ENDING WITH A ZERO BYTE
.END START
PDP Assembler information
PDP11 Assembler Tutorial - https://www.chibiakumas.com/pdp11/
RT11
THE PDP-11 HOW-TO BOOK - http://www.skrenta.com/pdpbook.txt
RT11 Editor hints - https://fjkraan.home.xs4all.nl/comp/miniminc/rt11_edit.txt
RT–11 Quick Reference Manual