Image Map Image Map
Results 1 to 7 of 7

Thread: Understanding the DEC BIN Loader program

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

    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
    684
    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
    968

    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
    684
    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
    968

    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
    684
    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.

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
  •