Image Map Image Map
Page 1 of 3 123 LastLast
Results 1 to 10 of 23

Thread: Understanding the DEC BIN Loader program

  1. #1
    Join Date
    Dec 2013
    Location
    Near Milwaukee Wisconsin
    Posts
    979

    Default Understanding the DEC BIN Loader program

    I'm attempting to understand how the DEC BIN loader for the PDP8E works. Recently I got my hardware, a Remex paper tape reader and the Parallel I/O M863 card to work as I expected it to. I had to write a new RIM loader to use the Remex and this seems to work as expected. Now I want to rewrite the BIN so that it to can again use the Remex reader. Downloaded DEC-08-LBAA-D which explains quite a lot. Next I began to look at the code. I'm still a relative novice at PDP8 coding, but improving.

    The BIN code starts out with looking at the current memory field. The extended memory is looked at as an I/O device, Device 21. This is saved and somehow should the paper tape change the memory field this is used. Don't know how exactly, yet.

    The main subroutine seems to be BEGG. Here the paper tape tracks are read. According to the DEC document the first item the program looks for is a RUBOUT. It says that Diagnostic Messages are contained between RUBOUT's and the BIN ignores them. I'm not sure I know what a 'Diagnostic Message' is or where they come from.

    But here is where I first stumbled over the code.

    Code:
    BEGG, 0                 /return address from a call
          DCA SWITCH    /Not sure what switch is either
          JMS READ        /Here is where the track is read
          TAD M376       /Add -376, this looks for the RUBOUT
          SPA SNA CLA   /Here is where I stumble.
          JMP L1
    A RUBOUT is 377. Then by adding -376 the result is 001. I think here is where either the RUBOUT or a LEADER track is sensed. My confusion comes from the combination command of SPA and SNA.

    SPA is skip on AC >= 0 & SNA is skip on AC is not zero. Doesn't that cover every possible number? Or am I confused on how this combination command works? Does the CPU test the SPA first and if true skips? OR does the CPU test each and decided based on both? Thanks Mike

  2. #2
    Join Date
    Aug 2010
    Location
    Silicon Valley USA
    Posts
    693
    Blog Entries
    4

    Default

    From the PDP-8 small computer manual: Capture.JPG so when you code SPA SNA both must be true to skip, so it will skip only on AC>0 (ie, AC>=0 && AC!=0)

  3. #3
    Join Date
    Dec 2013
    Location
    Near Milwaukee Wisconsin
    Posts
    979

    Default

    OK, just to be sure I understand.

    1. SPA will skip on any value where Bit#0 is zero. If bit #0 is a one, the number is negative, and no skip.

    2. SNA will skip on any value except zero.

    Then by placing them together there will be a skip only for AC>0. If these commands were done separately would this still work correctly? No, because the first test, if the value being tested was zero, would produce a skip. So by combining commands you can create a slightly different command. Thanks Mike

  4. #4

    Default

    Look at the Group 2 Operate instructions. The "OR" group is selected if bit 8 is zero. SMA SZA SNL work by skipping if ANY of those conditions are true. The AND group is selected if bit 8 is one, and all this does is take the logical inverse of the OR group selections (think Demorgan's theorem). In other words, for SPA SNA, skip if the result of SMA SZA is false.

  5. #5
    Join Date
    Aug 2010
    Location
    Silicon Valley USA
    Posts
    693
    Blog Entries
    4

    Default

    Quote Originally Posted by Mike_Z View Post
    OK, just to be sure I understand.

    1. SPA will skip on any value where Bit#0 is zero. If bit #0 is a one, the number is negative, and no skip.

    2. SNA will skip on any value except zero.

    Then by placing them together there will be a skip only for AC>0. If these commands were done separately would this still work correctly? No, because the first test, if the value being tested was zero, would produce a skip. So by combining commands you can create a slightly different command. Thanks Mike
    Correct. Per the little snippet I posted:

    If bit[8]=0, then bits[5:7] SMA(AC[0]=1) SZA(AC[0:11]=0) SNL(L=1) are logically OR'ed to skip
    If bit[8]=1, then bits[5:7] SPA(AC[0]=0) SNA(AC[0:11]!=0) SZL(L=0) are logically AND'ed to skip

    Sort of makes sense, as in the first case all the conditions tested are all mutually exclusive. ORing makes sense but ANDing does not, as SMA&SZA is never true.
    In the second case conditions one and two can both be true at once, so ANDing SPA&SNA makes sense, but ORing does not, because SPA|SNA is always true.

  6. #6
    Join Date
    Dec 2013
    Location
    Near Milwaukee Wisconsin
    Posts
    979

    Default

    Thanks, sometimes I can read something and completely miss a part. I appreciate the help.

    What if the combination is SPA SNA CLA. Is the accumulator cleared whether or not the skip occurs?

    Mike

  7. #7
    Join Date
    Aug 2010
    Location
    Silicon Valley USA
    Posts
    693
    Blog Entries
    4

    Default

    Quote Originally Posted by Mike_Z View Post
    Thanks, sometimes I can read something and completely miss a part. I appreciate the help.

    What if the combination is SPA SNA CLA. Is the accumulator cleared whether or not the skip occurs?

    Mike
    Yes. The skip only influences whether there is an extra PC+1 applied if the skip condition is met. All other microcoded operations (CLA, HLT, OSR) will always be executed.

  8. #8
    Join Date
    Dec 2013
    Location
    Near Milwaukee Wisconsin
    Posts
    979

    Default

    With the weather changing, it is getting harder to pay attention to these old computers. Yet when I do have time to review the DEC BIN LOADER, the software has had me confused a number of times. The DEC instructions always seem to do a little more than excepted. For example a DCA saves AC and also clears it, as do other instructions. But I believe I have gotten past a lot of this. Here is my latest question. The 'BEGG' sub routine, of the BIN LOADER, examines bits 4 & 5. There are four combinations that are test on these bits. If bit 4 & 5 is are both zero, the track has data. If bit 4 is a one, while bit 5 is zero, the track is the high address byte. If bit 4 is a one while bit 5 is zero, this is a leader byte. Here is where I'm not smart enough yet. If bit 4 & 5 are both ones, the software figures this is a field setting. Apparently, bit 4 & 5 both being ones, are somehow set when either the date or instruction fields are to be changed. I have read what it says about extended memory in the Introduction to Programming and the Small Computer handbook. But this doesn't seem to help me. I have looked at the extended memory instructions, but these instructions would be split up just like any other instruction. Is this something that PAL8 does? Where can I find out more about how the extended memory works. Thanks Mike.

  9. #9
    Join Date
    Dec 2013
    Location
    Near Milwaukee Wisconsin
    Posts
    979

    Default

    As my Dad would say "Fitsymay Dupa" (Dumb ass). I found the extended memory stuff in the Maintenance Manual Vol 2. Now I have to read and understand it. Mike

  10. #10
    Join Date
    Dec 2013
    Location
    Near Milwaukee Wisconsin
    Posts
    979

    Default

    I'm still working on the BIN loader, particularly the BEGG subroutine regarding the sensing Bit #4 & 5, when they are both ones. I have looked at all the MAINDEC. bn files I have and found that only one has a code like this C0(hex). It comes right after the leader. I believe that is a PAL8 FIELD instruction to set the field to zero. So I thought that I'd write a test program with a few FIELD instructions in it. Produce a paper tape and look to see how the field instructions are punched. Well.... I discovered that I didn't know much about making paper tapes. What I have done is used PIP and tried to make a tape. First I discovered that I do not have a PTR: defined, but using TTY: works. I tried this
    Code:
    *TTY:<BIN.BN/B
    This will punch a tape, but there is no leader or trailer. Must I add this to the code? Or how does one add the leader to a file?

    Thanks, Mike

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •