Skip to content

Latest commit

 

History

History
71 lines (50 loc) · 2.47 KB

README.md

File metadata and controls

71 lines (50 loc) · 2.47 KB

xmachine

A PDP-11 themed virtual machine.

The goal

While away my waking hours keeping myself amused.

What?

Oh right. Building this "thing". You'll need clang and make. Armed with those tools, run the following:

make all

You'll end up with a newly created bin/ directory containing this stuff.

Alright... now what?

With bin/xmachine built you can now do some stuff. Namely, run some simple PDP-11 assembly programs. For generating the machine code, I've been using MACRO-11. Currently, only loading a OBJ file with no offsets is supported. Basically, I just grab the TEXT section and load it into memory.

xmachine

Take your shiny new OBJ file generated by MACRO-11 and run:

bin/xmachine -o foo.obj

Usage

bin/xmachine -o <OBJ file>

Options:
    -d <disk image>     : file to use with the disk controller

Why?

Bit operations are fun, probably because I don't get to do much of that stuff in my working life. Something about working on simple virtual machines is fun. Probably because (in the simple cases at least) there's not much time investment until you have a program that does your limited bidding courtesy of a program written in its language. And finally, getting used to octal is interesting. I know there's not much to get used to, but having lived my life never having to think about it outside of file permissions, it's a change from hexadecimal.

This will probably never be finished, or useful. The more I end up working on these things, I don't think that was the goal anyway. In any case, this might morph into more of a PDP-11 as time goes on. Right now I'm just borrowing its opcode format and some registers, while having fun.

References

  • Michael Singer, PDP-11. Assembler Language Programming and Machine Organization, John Wiley & Sons, NY: 1980.
    • This helped me out with immediate addressing, as the Wikipedia article, while pretty good, is a little unclear for someone who never programmed a PDP-11 in their lifetime.

DEC Manuals

You can find most of these on bit savers or bit saver mirrors.

  • EK-RX01-0P-001 RX8/RX11 floppy disk system user's manual, Digital Equipment Corporation: 1976.
  • PDP11/40 Processor Handbook, Digital Equipment Corporation: 1972.
  • DEC-11-HIAA-D Unibus Interface Manual, Digital Equipment Corporation: 1970.
  • PDP11 Peripherals Handbook, Digital Equipment Corporation: 1976.
  • RT-11 Volume and File Formats Manual, Digital Equipment Corporation: 1991.