• Please review our updated Terms and Rules here

Getting started with Macro11 on RT-11 (using simh)

GreyHairedDECfan

Experienced Member
Joined
Dec 5, 2021
Messages
132
Location
Northern Maryland
How best to get started on this, do I need an assembler? Where to find a programming manual?

Very experienced in programming, many languages, but never stepped into assembler.
 
With SimH, you can start barebone, using the deposit and examine commands. To use Macro on any operating system (my choice wouldn't be RT11, though) you need assembler and linker (task builder). Both are the standard tools (not layered products) in any DEC OS for PDP-11. The manuals can be found on Bitsavers.
 
I might suggest getting started with something like PDP11GUI which is a Windows program that has an integrated
Macro11 assembler and Linker, and a SIMH PDP11 as well. You can use it to write and test simple Macro11 standalone
programs. Available here: https://www.retrocmp.com/tools/pdp11gui

It is not an RT11 environment, but rather standalone PDP11 with no integrated OS support.

Starting up with RT11 (or other DEC OS for that matter) is non trivial. Besides the system image and requisite PDP11 (real or SIMH)
you will need get/learn a text editor (like TECO) or find some way to get external source program files into your simulated PDP11.

Just a thought. Getting PDP11GUI going is pretty easy and using it to learn PDP-11 assembly and instruction set is straightforward.
 
There are more recent manuals on bitsavers (in pdf/dec/pdp11/rt11/v5.6_Aug91/) and they are searchable.

You can certainly do development under actual DEC OS using native tools, but modern tools and editors are nicer. For example, https://gitlab.com/Rhialto/macro11 supports longer labels, although it doesn't do jump expansion.

https://www.retrocmp.com/tools/tu58fs is a way to get files in and out of a running pdp-11; you'd need a bridge (socat or com0com or similar) to use it with SIMH, since it's designed to work with a physical serial port.
 
To get started with assembler, you'll need an assembler for the specific architecture you're working with. A good programming manual is key—check out the official documentation for comprehensive guides.
 
The C source code for a MACRO-11 cross-assembler is available online, as is a perl script to convert the object file output from the assembler into a HEX file.

The macro11 tool I use advertises itself as:

1736086511290.png

And the obj2hex.pl script as:

1736086614533.png

This gets a lot of the MACRO-11 source debugged on my iMac (other Operating Systems are available) before I ever go anywhere SIMH or a real PDP-11. And you can use your favourite text editor.

I have noticed one 'bug' with the assembler though, it does not like the source line"JMP @(R0)+", even though this is valid. I will look into this someday and see if I can fix it.

It does help to get a lot of the syntax errors etc. sorted out though. You can then copy it to SIMH and use the assembler under (say) RT-11.

Dave
 
In fact, I have just written myself a very noddy DLV11-J ECHO program using the above cross assembler to test out my DLV11-J card later on in the week.

Dave
 
There is an updated version of macro11, I'm currently using the 0.8 revision.

~[501] macro11

macro11 - portable MACRO11 assembler for DEC PDP-11
Version 0.8 (macro11-v0.8
Olaf Seibert <rhialto@falu.nl> Thu, 7 Jul 2022 07:07:07 +0000)
Copyright 2001 Richard Krehbiel,
modified 2009 by Joerg Hoppe,
modified 2015-2017,2020-2021 by Olaf 'Rhialto' Seibert.

Usage:
macro11 [-o <file>] [-l [<file>]]
[-h] [-v][-e <option>] [-d <option>]
[-ysl <num>] [-yus]
[-m <file>] [-p <directory>] [-x]
<inputfile> [<inputfile> ...]

from: https://github.com/Rhialto/macro11

It may have fixed your bug.

And my PDP-11 linker perl application is available here: https://github.com/AK6DN/obj2bin

These are the tools I use to assemble/link my diagnostic programs for PDP-11 into run-able binaries .BIC/.BIN usable with SIMH or for insertion into XXDP filesystem compatible TU58/RX02 disk images.
Available here: https://ak6dn.github.io/PDP-11/DIAGNOSTICS/
 
Guys, if you're looking for cross-platfom replacement for native MACRO and LINK, I'd recommend:
https://gitlab.com/Rhialto/macro11 -- there's a lot of open-source macro11 projects, but this one aims to be very close to the original MACRO, all it's output formats (map, listing etc.) are very close too.
https://github.com/nzeemin/pclink11/ -- I worked on this one some time ago, using original LINK code as base and reference, so basically it's original LINK converted to C++ (not all the original features implemented though).

Also, there's another approach: to run RT-11 right from Windows command line, take a look at RT-11 simulator by Patron: http://emulator.pdp-11.org.ru/RT-11/distr/
You can use rt11.exe to run native MACRO/LINK on you .MAC files natively, the RT-11 will use your files from the curent folder, and you'll have resulting .OBJ/.SAV in the same folder, so no need to copy to some disk image and back.
 
In fact, I have just written myself a very noddy DLV11-J ECHO program using the above cross assembler to test out my DLV11-J card later on in the week.

Dave
How do you get files on to / off of SIMH?
 
How do you get files on to / off of SIMH?

One way I did this a few years ago so that I could run MACRO on RT-11 in SIMH was to edit source files on the host system outside of SIMH, then use PUTR to copy the source file to the SIMH disk image before starting SIMH. Then start up SIMH and boot the RT-11 disk image and run MACRO on the copied over source file.

I forget if I was using SIMH configured with a single disk image so that I had to exit SIMH every time I wanted to use PUTR to copy an updated source file to the disk image, or if I had SIMH configured with a boot disk and a second disk that I could take offline and detach from SIMH so that it could be updated without shutting down and restarting SIMH.

This could be a little tedious if you're making a lot of small edit / assemble / repeat cycles, but not too bad if you're not doing a lot of churn as it doesn't take too long to restart and shutdown RT-11 on SIMH.

http://www.dbit.com/putr/
 
How do you get files on to / off of SIMH?

If you use the above mentioned Rhialto gitlab/github macro11 (I run it under cygwin on a Win 10 PC) and my obj2bin.pl linker
(or another linker) to create .BIN/.BIC standalone loadable PDP-11 images, then you can load these standalone program images
directly into SIMH PDP-11 memory using the LOAD command. So in a SIMH .ini file:

Code:
set cpu 11/44 4096K
show cpu
load memx.bin
go 200
bye

where I used macro11 to assemble memx.mac into memx.obj, and obj2bin.pl to link memx.obj into memx.bin.
So running fully standalone PDP-11 programs, no operating system needed (or wanted in this case).

Or in other cases, I take the generated .bin/.bic files and use my xxdpdir.pl script to build XXDP disk/tape images
XXDP uses basically the DOS-11 filesystem and the program images on the disk are PDP-11 absolute loader .bin/.bic
file images (same ones you can load into SIMH PDP-11 using the load command).
 
Lessee....I mostly have used it for RSX, not RT, but it ought to be more or less the same.

To read in
CTRL-E SIMH and attach a file to the paper tape reader.
simh>att ptr infile.fil
resume SIMH and copy from the tape reader
>pip afile.fil=pr0:
CTRL-E and detach the reader
det ptr

To write out
CTRL-E SIMH and attach the punch to a file
simh>att ptp outfil.fil
resume and write out the file
>pip pp0:=outfil.fil
CTRL-E and detach the file
simh>det ptp
 
I asked ChatGPT to crank out a Top10, and I think it did a pretty useful job, so sharing here:

Here are the Top 10 things you need to know to effectively use the command line to inspect, configure, and use RT-11:




1.​


  • RT-11 commands are concise and often three-letter abbreviations (e.g., DIR, RUN, DEL).
  • The general syntax is: COMMAND ARGUMENTS
    • Example: DIR DU0: lists the directory of the first disk.



2.​


  • Devices are named with two letters and a number:
    • DU0: Disk Unit 0 (usually a floppy or hard disk).
    • TT0: Terminal device (console).
    • LP: Line Printer.
  • Always specify a device before file operations:
    • Example: COPY DU0:MYFILE.TXT DU1:



3.​


  • Use DIR to list the files on a device:
    • DIR DU0:
  • Use PIP (Peripheral Interchange Program) for detailed file operations:
    • Example: PIP DU0:*.TXT /LI (lists all .TXT files with details).



4.​


  • RT-11 includes a basic editor, EDIT, for creating or modifying text files:
    • EDIT DU0:MYFILE.TXT
  • Use the TYPEcommand to view a file:
    • TYPE DU0:README.TXT



5.​


  • RT-11 programs are executed with the RUN command:
    • RUN DU0:PROGRAM.SAV
  • Programs must have .SAV or .TSK extensions.



6.​


  • Use the SHOWcommand to inspect the system configuration:
    • SHOW DEV displays connected devices.
    • SHOW SYS displays the current system status.
  • Use SETto configure devices or the environment:
    • SET TT QUIET suppresses terminal output.



7.​


  • Common file operations include:
    • COPY: Copy files between devices.
      • Example: COPY DU0:FILE.TXT DU1:
    • DELETE: Delete files.
      • Example: DELETE DU0:OLD.TXT
    • RENAME: Rename a file.
      • Example: RENAME DU0:FILE.TXT NEWNAME.TXT



8.​


  • Boot RT-11 by loading the monitor into memory.
  • Use the BOOT command (if applicable) or ensure the bootloader is correctly configured for your hardware.



9.​


  • ODT: On-line Debugging Tool for inspecting and modifying memory/registers.
  • MACRO: Assembler for creating .SAV files.
  • LINK: Links object files to produce .SAV executables.



10.​


  • RT-11 provides limited but useful built-in help:
    • HELP or HELP &lt;command&gt;
      • Example: HELP COPY
  • Keep a copy of the RT-11 documentation handy for detailed reference.



These core concepts should give you the foundational knowledge to inspect, configure, and use RT-11 effectively! If you need specific command examples or details on one of these topics, let me know.
 
Back
Top