I'm trying to run the (a slightly adapted version but the original gives the same problem) example program from How to implement a 'write' function in pdp-11 / MACRO-11 / ODT using simh? in simh. I would like to see its output in a file or a telnet session.

For that I assembled it using https://github.com/pdpy11/pdpy11 Then I added a header and loaded it in simh:

sim> set dli en
sim> set dlo en
sim> attach dli 2222
Listening on port 2222 (socket 3)
sim> load test2.bin
sim> run

The program then runs upto the trap statement that I added after the jsr.

Unfortunately, I receive no output on telnet port 2222.

start:  MOV #stack_end, R6
    MOV #text, R0
    CALL    printstart
    TRAP    07

text:   .ASCII  "test\x00"

printstart: MOV R0,-(SP)

print:  CMPB    #00,(R0)
    BEQ pdone

    MOVB    (R0), @#TTYTX

waittx: TSTB    @#TTYST
    BPL waittx

    INC R0
    JMP print

pdone:  MOV (SP)+,R0


stack:  .BLKB   4096.

TTYST   =   177564
TTYTX   =   177566

What should I do in simh to make this work?


p.s. pdpy11 assembler does not add a .bin-header, for that I wrote https://vanheusden.com/emulation/pdp11/raw_to_simh_bin.tgz

1 Answer 1


177564 is the CSR address of the console tty output.

Your simh configuration is adding an actual DL11 device, which will have a different address. The output CSR for the first DL11 is 176504; this is confirmed by the peripherals handbook as quoted in my answer here, and by simh itself:

sim> sho tto
TTO     address=17777564-17777567, vector=64, BR4, 7p
sim> show dli
DLI     address=17776500-17776677, vector=300-474*, BR4, lines=16
sim> show dlo
DLO     16 units
  DLO0  UC, no dataset, no logging

If you just want to test your program, I suggest attaching to the console tty. Alternatively, try the DL11 unit 0 address.

  • So I do "r" / "set console telnet=3333" / "load test.bin" / "run"? Because the only output I get the on telnet port 3333 is "Connected to the PDP-11 simulator". I also added cr/lf to my test-output but that did not help (in case it is lined-based). Mar 13, 2022 at 9:00
  • Oh never mind: it does work with the original example when I move the string behind the code so that it doesn't get executed :-) Mar 13, 2022 at 10:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .