• Please review our updated Terms and Rules here

Need some help with interpreting octal code

billdeg

Technician
Joined
Nov 18, 2003
Messages
3,885
Location
Landenberg, PA USA
here is a code that prints rows of characters and spaces
500 005000
502 105737
504 177564
506 100375
510 110037
512 177566
514 105200 (increment destination)
516 000771

(I got this code from here):
http://www.pdp-11.nl/pdp11-05/cpu/boards/m7260.html

QUESTION
How do I determine which character the program is saying should be printed? What is the character (ascii code). I am not getting how to interpret the 2nd line below:

502 105737 "test destination address 37"
and then
510 110037 "move what's in 00 to 37"
----------------------------------------------------------------

I tried to use pages like this (to look up octal ascii)
http://rabbit.eng.miami.edu/info/decchars.html

I am trying to teach myself to write little programs using the front panel, the DEc processor handbooks have few useful examples that show both the octal and the assembler together. I have been inefficiently working through the books, spending hours on it, but I have no way to "check my work"

BTW - the program above works and I have been able to run it and use to sharpen the baud rate of my M7260 processor. I guess where I am confused is the difference between the arbitrary coding (pick a register, print an ascii character) and the must-have stuff.

I had the same problem trying to learn C, I think differently I guess...but once I understand in my terms it's usually a piece of cake.
 
Last edited:
Hi Bill,

My opcode disassembly may be a little rusty, but...

Code:
500 005000 CLR R0
502 105737 TSTB @#177564
504 177564
506 100375 BPL -3
510 110037 MOVB R0,@#177566
512 177566 
514 105200 INCB R0
516 000771 BR -7
It is basically outputting an ASCII character to the TX register [177566], each time the status register [177564] says the transmitter is empty.

The ASCII value is held in R0, begins at 0 and is incremented with each character sent. R0 is not reset, and therefore the character values goes from 0 to 255 [decimal] as the register advances.

I think the idea of the program is to send characters while you adjust the oscillator to set the bit rate, until you see valid characters printing with no errors?

It's a little crude. Might have been better to keep R0 in the printable range, but it's a start.

Is that any help?

You might find a Programming Card handy, if you don't have one. Or maybe someone knows where there's a nice PDF of one you could download and print out?

UPDATE:

Here's a PDF version, but it's been rode hard and put away wet. Anyway, it will give you an idea of how the panels were meant to be.
 
Last edited:
The code referenced above, when I run it just prints one character over and over. Something simpler; what would be the octal code to print just

ABC ABC ABC ABC etc

The way I think is to build on things one step at a time, thanks for your help.

Bill
 
A few thoughts...

The code referenced above, when I run it just prints one character over and over.
I'd need to verify it here to be certain, but it shouldn't act the way you're describing. After all, you are trying to solve one issue in a system with multiple concurrent unknowns. Other problems could be obscuring the view.

Something simpler; what would be the octal code to print just

ABC ABC ABC ABC etc
I'm not sure how to best help you Bill. I realize you're "plowing through" for the fun of it, and I don't want to interfere with that. On the other hand, if it's reaching the point of frustration, I want to help.

  • I can re-write the code for you, but is that really "helping"?
  • Would it be better to help you re-write it?
  • Or maybe I could write a blow-by-blow explanation of the above program's execution?
If one already has an "assembly code" background in another machine, PDP-11 is not too big a stretch to "pickup". However, a strictly high level coder may have difficulties if it's their first foray to the front lines.

I have been scouring the house for one of my "programming cards". They must have all been collected together at some point in the past, because I'm not finding ANY of them. [I must have 50 by now - only a few are PDP-11s, obviously]

I "see" them in my mind's eye... but can't "place" them. This could take a while.

Anyway...

If you really want to get a working handle on the instruction set [and not just "fix your hardware"], a programming card and hand coding will really help cement the concepts and particulars in place. The exerciser you propose is a very simple and clean one to begin on.

Frankly, I love doing this s__t. When one is debugging "first time" prototypes, it's frequently necessary to resort to multi-disciplinary measures like these to figure out what's wrong.
I.E. - Write little programs to exercise a suspected hardware device while watching it's behavior on a scope or other tool.
Quite often, a full blown operating environment simply cannot run yet because of device flaws, so compiled programs are of no use, or just may not be expedient.

Am I off the mark for you here... am I going too overboard??
 
Was there a DEC training manual with lessons and instructions, and sample code similar to say the 6800 books? I would want something specific to the earlier pdp 11's (20, 05.10,35,40) My computer education is mostly programming languages, not lower-level assembly. I have 0 experience with machine language, but I am very experienced in entering programs, reading/setting octal values using the front panel. I just don't always understand how they work.

My immediate goal is to convert the following to octal (echo characters to the printer), but also at a reasonable pace I would like to start from the beginning and learn how to at least read assembly code and covert into octal, even if I don't actually write much other than simple test programs.

Bill


TSTB RCSTA
BPL
TSTB XMITST
BPL
MOVB RCDB, XMIT
TSTB XMITST
BPL
MOVB NULL, XMIT
TSTB XMITST
BPL
RESET
 
Last edited:
You know, there probably was a training manual like that, but I don't know if I have one because it's not how I learned. I attended the "Sink or Swim" course... throw em in the water and see if they learn to float.

He, he... more fun that way.

I'll look to see if I have anything appropriate, but the closest I'm sure of is Macro 11 - A Self Paced Course. I don't think it's intended to teach the machine, but I'll look.

On the actual model... PDP-11/20 etc... there are very few machine specific instructions, and using them was discouraged except where absolutely required. If you train for good habits on older models, then the code "usually" works on newer ones.

Here's a crack at your requested program. I did not question your instructions, I "just did it" - except "RESET"... where I branched back to the beginning. If you wanted a HALT, replace the last instruction with HALT [000000], or an actual RESET [000005]

I did make a few assumptions:

  • I assumed the DL is the target serial device with:
    • D7 = 1 of the Receive Status register [177560] indicates "RX Data Ready"
    • RX Data is 177562
    • D7 = 1 in the Transmit Status register [177564] indicates "XMTR Ready"
Notes:

  • The program does not look for RX Errors. Hopefully RX Data Ready will be true anyway.
  • This code is "relocatable", and need not be in any particular memory location
  • I inserted empty lines to delineate steps
  • I would expect this program to echo any RX character, followed by a NUL [two characters for one]

Code:
005000 CLR R0

105737 TSTB @#177560
177560
100375 BPL -3

105737 TSTB @#177564
177564
100375 BPL -3

113737 MOVB @#177562,@#177566
177562
177566

105737 TSTB @#177564
177564
100375 BPL -3

110037 MOVB R0,@#177566
177566

105737 TSTB @#177564
177564
100375 BPL -3

000756 BR -16
Let me know how you make out.
 
Last edited:
by jove it worked! WIth this program I was able to adjust the potentiometer on the M7260 processor board until I got a consistent and accurate echo. Now I can proceed with the confidence that I have the baud rate correct, at least enough for keyboard to printer throughput.

Next I will study how you converted this code and put more of the pieces together. I will also attempt to save and re-load papertape programs.

I can't thank you enough! Greatly appreciated.
 
I've also found this thread very interesting. I've been learning PDP-11 opcodes and their octal toggle patterns in preparation for the arrival of my PDP-11/05 from the US in the next month or two (it's in a container on a slow boat). I've been perusing Bill's site and hope to follow the same steps in hopefully getting the machine working.

I don't have the processor handbooks but I've found the following books to be quite informative:

The Minicomputer in the Laboratory by James W Cooper 1977 365 pages
Nice easy intro into the PDP-11 instruction set, and how to toggle. Covers I/O subroutines, printing octal numbers, ODT, the floating point math package, A to D and instrumentation reading using the LPS-11 and lots of worked examples. Well worth reading for the most part.

Minicomputer Systems: Organisation and Programming (PDP-11) by Richard Eckhouse 1975 345 pages
Just got this one a few days ago and I'm impressed. Covers boolean algebra and logic functions, addressing methods, PAL-11, subroutines, and is pretty solid on stacks, shelves, queues, linked lists etc, interrupt programming, disk operating system. What is really neat is a chapter on building a simple multitasking executive in a few hundred bytes. A top book.

Machine and Assembly Language Programming of the PDP-11 by Arthur Gill 1978 191 pages
This one I have mixed feelings about - definately not as nice to read as the other two as it's a bit terse but that's probably due to it being only 191 pages. Still good to get another handle on programming. All assembler examples have the octal code so it'd be very easy to toggle.

These books were cheap (only a US dollar, most expensive was two US dollars, not including postage to Oz) and there are plenty of copies available on abebooks. I think they would help Bill a lot with his aim to toggle in from the panel, as I have the same goal.

Steve.
 
My original reply seems to have disappeared....long story short, thanks for the book ideas. I will order some.
Bill
 
Last edited:
I've also found this thread very interesting. I've been learning PDP-11 opcodes and their octal toggle patterns in preparation for the arrival of my PDP-11/05 from the US in the next month or two (it's in a container on a slow boat). I've been perusing Bill's site and hope to follow the same steps in hopefully getting the machine working.

I don't have the processor handbooks ...
Everything you could have required would have been at the University of Queensland's Computer Museum of I.T. ... now disbanded.

Considering where you are located, you might try to contact the University about your interests. I have tried unsuccessfully, but then again I'm half a world away.

Thinking about the loss of this Museum makes me cry. It had the only remaining operational PDP-10 system I am aware of, as well as many others. [PDP-11s, VAXs...]

Disheartening.

However, many of the DEC Handbooks are available elsewhere Online. Any idea which you are interested in? Here are some popular ones...

You can also find the PDP-11 Paper Tape manual and the actual PDP-11/05 Processor Manuals. A Google search of "DEC Handbook PDF" often brings up the most interesting results.

If you can't locate these, let me know.

 
by jove it worked! WIth this program I was able to adjust the potentiometer on the M7260 processor board until I got a consistent and accurate echo. ...
Congrat's Bill... it's been a long time coming for you.

Just for curiosity's sake... now that your potentiometer is adjusted, what happens when you run the original program?
 
You can also find the PDP-11 Paper Tape manual and the actual PDP-11/05 Processor Manuals. A Google search of "DEC Handbook PDF" often brings up the most interesting results.

If you can't locate these, let me know.

Just about any of the DEC documentation that is online is available at: http://www.bitsavers.org/ or one of it's many mirror's around the world.

DEC .pdf documents are under: http://www.bitsavers.org/pdf/dec/

For example, here is the DEC training course on PDP-11 programming:

http://www.bitsavers.org/pdf/dec/pd...oduction_To_Programming_The_PDP-11_197309.pdf

Bitsavers also has software images of papertapes and disks.

I would recommend you spend a bit of time exploring Al's site, as it probably already has every bit of DEC documentation online that you will likely ever need.

Don
 
Don... are you the author of that one? [Don Lawrence?] Nice to know you, if so. [or even if not]

I am never going to be a good judge of how elementary an intro to PDP-11 should be. I can't pretend I don't know, what I know.

I suppose if one were not at all versed in machine level particulars of any kind, that would be a good introduction to the topic generally, and get one started in the PDP-11 instruction set and architecture.

Being an experienced programmer as you are Bill, I would expect you to want to begin at chapter 3.

Don is there a second edition of this? Maybe one for the more advanced students?

Incidentally Bill, you will still benefit greatly from a PDP-11 Programming Card mentioned in my earlier post.
 
Congrat's Bill... it's been a long time coming for you.

Just for curiosity's sake... now that your potentiometer is adjusted, what happens when you run the original program?

Same thing pretty much a strange character and a space, over and over.

Bill
 
Last edited:
Same thing pretty much a strange character and a space, over and over. I would trust the echo program more as it came from the pdp 11/05 manual.

That is rather odd. I wonder if the interface is set to the correct number of stop bits and word size? Anyway, thanks for re-running the test.

Better test... Can you use the console to deposit ASCII character value at the transmitter address [177566] and see them output on the terminal?

You should also be able to type a single character, and read it from the RX Buffer address. [177562].
 
Last edited:
That is rather odd. I wonder if the interface is set to the correct number of stop bits and word size? Anyway, thanks for re-running the test.

Returning to the echo program from the pdp 11/05 manual - this program is pretty definitive as far as debugging. Press A and A should appear on the printer. NO? Adjust baud rate. Press AAAAA repeatedly, a string of A's with no stray characters.

The teletype has a repeat key. If I press E + repeat and hold down the repeat key, the TT will keep sending a stream of E charcters to the computer even if I take my finger off the E key and until I disengage the repeat key. I tryed every key on the keyboard this way. I found that some ascii characters are more "stable" than others and need a lower precision of baudrate than others. At least for me. When all keys were working 100% I knew I had the right baud. The closed circle.

Next I can try to save to tape and retrieve the values from memory knowing probably the baud rate is ok. THEN I start using the programming manuals. I have the reference card, picked one up from my office today.

My first program will be to save a block of memory to tape, and then retrieve the block to a different location. Or change all memory to a specific character, etc.
 
I guess I should explain my concern.

Echoing characters is not really a perfect test, because the terminal's repeat rate probably won't be as fast at the serial line can go. This causes extra time in between characters that can help to mask a misadjusted word size or stop bit setting. However, when the computer is outputting real data, it can go that fast.

If you find that characters get scrambled when they're just coming from the computer [as they would be in a memory dump to tape or printable output of any real size] then you'll need to revisit this issue.
 
I agree. I can output memory dumps to the printer, so I can check for errors in the computer's output at full speed. Of course I have to program this first...But assuming I can pull it off that's much more telling than the echo test.
 
Last edited:
does this help? it says heathkit h11 but thats also a pdp 11 lsi-11
heathh11.jpg

heathh111.jpg
 
does this help? it says heathkit h11 but thats also a pdp 11 lsi-11
It's nice to see that card, is it available in higher resolution suitable for re-printing? I'd like to save a copy.

The H11, as you said, is an LSI-11 and is mostly "like" his UNIBUS machine's instruction set, except in a few areas. [MTPS, MFPS etc...]

I've been hoping to locate my original PDP-11 Programming cards, to make a High-Res version for him to be able to print. [electronic copies are nice, but there's nothing like a real card when your toggling in a program]

The two links I provided give the "information", but aren't particularly re-printable. The ideal would be a good clean unused one, so a file could be taken to Kinko's or someplace to have it printed on real card stock, or plastic. If I can get to this, I'll make them available to anyone who wants them.
 
Last edited:
Back
Top