return to main page

3-Card 1401 Loader
by Mike Cheponis
7 Mar 2007

The Problem: "Load Mode" loading requires carefully setting wordmarks and being very careful to move data out of the card reader's area to some place in memory where the program will reside.

The "Condensed Loader" format described in IBM C24-3259 is really meant for autocoder output, so that fewer cards are punched.

This new format is proposed to make it easier for humans to transcribe 1401 code from an Autocoder listing or manual assembly.

---

A special 3-card loader program will be placed in front of a deck of program-to-be-loaded cards.

A copy of this 3-card loader is on top of the 1402 Card Reader. Use, and make copies, as required!


Format of the program-to-be-loaded cards:

columns 1-3: Address to load, in standard 1401 "3-digit address" format
columns 4-80: Data/Program to load

Special Characters used:


        Original Meaning  Meaning for 3-card loader
        ----------------  -------------------------
  0-5-8 Word Separator    "SET WM"
  0-7-8 Tape Segment Mark "END/START"


Example program:

                        org 334
334  /332      start    cs  332
338  /                  cs
339  2         again    w
340  A340339   	        a   *-6,again
347  .         	        h
348                     dcw  @ @
           	        end start


Card Contents for example program:

   0    0 0 0       0 0
3345/3325/525A3403395.5     Note that the 0-5-8 punch signifies that a Word Mark 
   8    8 8 8       8 8     is to be placed under the next character.




The only case 0-7-8 is used is the "end/start" card; column 80 holds the 0-7-8.  
For the example immediately above, this last card would be:

                                                                               0
B334                                                                           7   
                                                                               8

meaning to start the program at address 334;  0-7-8 is punched into column 80.  
    Note that it's just a Branch instruction.

If there is no 0-7-8 in Column 80, the loader program reads another card 
    and loads that, and keeps doing that until a 0-7-8 is detected in column 80; 
    when the 0-7-8 is detected in column 80, the loader program jumps to location 1.

What the 3-card loader really does is load the whole card into memory; 
   so in the above example, where the rest of the card after the last   
   0-5-8 punch is blank, blanks are loaded into memory (up to column 80).  

Therefore, it's important to keep your program-to-be-loaded cards in ascending address order,
   so the subsequent cards overwrite any blanks of the previous card that are not wanted.

So, in the above example, we could have used two cards (instead of one) like this:

   0    0 0
3345/3325/52
   8    8 8

   0       0 0
3405A3403395.5
   8       8 8

(But the point of the format is to allow as many columns as convenient, 
   requiring fewer cards!)


Using this format, you cannot load a 0-5-8 character into memory; 
   this hopefully is not a nasty limitation, and, in any case, is fixed    
   with the proposed extensions, below.  

You can load 0-7-8 into memory, as long as it's not in column 80.  
   You can load any other valid character into memory.

If you have two (or more) 0-5-8 punches in a row, it's considered as a single 0-5-8 punch, 
   that is, it sets the (one) wordmark under the next character.

-----------------------
There are two extensions I'm in the process of making on a future version:

  1. Allow 5-character addresses everywhere a 3-character address can be used, and automatically translate the 5-character address into a 3-character address

  2. Permit program re-location by changing a single card. At the moment, all programs are loaded into absolute memory locations. I have a way of specifying relocatable addresses, so whole programs could be put anywhere in memory.
(I have a spec for these, but I didn't want to confuse the issue by sending that to you now; instead, just sending you the spec for what is actually implemented and works.)

These extensions aren't particularly difficult, but I haven't had a need for them yet; but I could be talked into getting these extensions done if there were some "user demand" !

p.s. There is a sample "Count to 100,000" program along with the 3-card-loader on top of the



Better Version 21 March 2007

x1 is pointer to card column -1.  It's -1 because then I can compare for '8' to know if I'm done
so I need to have +1 when I do the moves (which is easy to do)
x1 is 87-89   x2 is 92-94   x3 is 97-99  (x3 is not used here)

                    org     100
100 /099      start cs      99
104 ,001            sw      1                prepare read-in area
108 1         read  r                                                                                       
           0 
109 B0010807        bce     1,80,oh78        CC80 have a 0-7-8 punch?  If so, execute the program’s "Bxxx" card
           8                                                                                                    
117 M003094         mlc     3,x2             else Pick up address, where this stuff will go  (dest)
124 M120089         mlc     *-10,x1          init source address to 003  (and the 'M', too, is moved, which is ignored)
131 )0-0      load  cw      0+x2             whatever is at dest, no WM please
           0
135 B1830|15  set   bce     setwm,1+x1,oh58  0-5-8 seen?  If so, set the wm 
           8
143 D0/10-0         mn      1+x1,0+x2        load the character into memory
150 Y0/10-0         mz      1+x1,0+x2
157 H0890|1         sbr     x1,1+x1          next card column  (A-8-2 is 10's digit of B field, a record mark)
164 H0940-1         sbr     x2,1+x2          next location in memory for dest
171 B1080888        bce     read,x1-1,8      If we've moved past the end of the card, go get another card
179 B131            b       load             Else we've got more to go on this card
	
183 ,0-0      setwm sw      0+x2
187 H0890|1         sbr     x1,1+x1          Gotta do this here because we must jump back into scan loop
194 B135            b       set              A bug here is that we don't compare against '080' and quit; but too bad

198                 nop                      Just really needs a WM here
199

Note that “oh78” is a 0-7-8 punch and “oh58” is 0-5-8 punch

         1         2         3         4         5         6         7         8
12345678901234567890123456789012345678901234567890123456789012345678901234567890
,008015,022029,036040L074134,1041081001/099,0011B0010807M003094M120089)0-0.CARD1
1      1      1      1      1      1   1               8

         1         2         3         4         5         6         7         8
12345678901234567890123456789012345678901234567890123456789012345678901234567890
,109117,124131L075170,143150,1571641001B1830|05D0/10-0Y0/10-0H0890|1H0940-1CARD2
1      1      1      1      1      1   1      8

         1         2         3         4         5         6         7         8
12345678901234567890123456789012345678901234567890123456789012345678901234567890
L067198,179183,187194,198199N000000B100B1080888B131,0-0H0890-0B135N........CARD3
1      1      1      1      1      1   1 





return to main page