23 Jun 2011 13:58                              IBM 1130 Assembler E  v0.9                                        1
iplboot.asm                                       IPL Bootstrap Loader                              

Loc. Object code    Expr. Line   Statement

                             2   *-----------------------------------------------------------------------
                             3   *
                             4   *        OS/1130 Operating System  |  IBM 1130 model 7
                             5   *
                             6   *
                             7   * Component:      IPL Programs
                             8   * Module:         Bootstrap loader
                             9   *
                            10   * Description:    This module is a simple 2-card bootstrap loader for
                            11   *                 the IPL feature of the 1130. It can bootstrap a
                            12   *                 program punched in 72-column 1800 format, which
                            13   *                 punches each word in two columns.
                            14   *
                            15   *                 The program is loaded starting at address 7168 (7K).
                            16   *                 Any number of cards can be loaded. The end of the 
                            17   *                 deck is indicated by the sequence number 9999.
                            18   *
                            19   *                 Control is given to the program at address 7168.
                            20   *
                            21   * Notes:          The first card of this loader is an 1130 IPL card,
                            22   *                 so there can be no 1 bits in positions 5--7 of the
                            23   *                 words, and bits 8 & 9 must be the same. The second
                            24   *                 card is in 72-column 1800 format.
                            25   *
                            26   * Author:         Paul C. Anagnostopoulos
                            27   *
                            28   * Created:        6 April 2011
                            29   *
                            30   *-----------------------------------------------------------------------

                            32            list        push,nogenerated
                            33            lowmem       
                            34            devcode      
                            35            iofunc       
                            36            dev1442      
                            37            dev2501      
                            38            bootitem     
                            39            list        pop

                            41            abs          
0000                0000    42            org         0x0000            We start execution here.

23 Jun 2011 13:58                              IBM 1130 Assembler E  v0.9                                        2
iplboot.asm                                       IPL Bootstrap Loader                              

Loc. Object code    Expr. Line   Statement


                            44   * We must build any words with 1 bits in positions 5--7 or with
                            45   * bits 8 and 9 different.

0000 C02D           002E    47            ld          packld            Build pack loop load instruction,
0001 1008                   48            sla         8
0002 D02B           002E    49            st          packld
0003 C02D           0031    50            ld          packor            and or instruction.
0004 1008                   51            sla         8
0005 D02B           0031    52            st          packor
0006 7006           000D    53            jmp         init2             Continue after interrupt vector.

                            55            assert      (* <= lm$int0)
0008                0008    56            org         lm$int0
0008 003E           003E    57            dc          colint            Address of column interrupt handler.

0009 0048           0048    59   colct    dc          72                Number of columns with data.
0009                0009    60            org         *-1
0009 0024           0024    61            dc          72/2
000A 0000 1703      0000    62   sense2   iocc        0,dev@1442,iof@dsw,c2@rset0+c2@rset4
000B                000B    63            org         *-1
000B B818           B818    64            dc          (dev@1442 .< 14)+(iof@dsw .< 11)+(0b11 .< 3)

                            66            assert      (* <= lm$int4)
000C                000C    67            org         lm$int4
000C 002B           002B    68            dc          compint           Address of operation complete handler.

                    000D    70   init2    equ         *
000D C025           0033    71            ld          packst            Build pack loop store instruction.
000E 1008                   72            sla         8
000F D023           0033    73            st          packst
0010 C0F8           0009    74            ld          colct             Build column count.
0011 1001                   75            sla         1
0012 D0F6           0009    76            st          colct
0013 C0F7           000B    77            ld          sense2+1          Build 1442 sense IOCC,
0014 1803                   78            sra         3
0015 D0F5           000B    79            st          sense2+1
0016 8038           004F    80            a           sense1+1          and 2501 sense IOCC,
0017 D037           004F    81            st          sense1+1
0018 C030           0049    82            ld          start2+1          and 1442 start IOCC,
0019 1801                   83            sra         1

23 Jun 2011 13:58                              IBM 1130 Assembler E  v0.9                                        3
iplboot.asm                                       IPL Bootstrap Loader                              

Loc. Object code    Expr. Line   Statement

001A D02E           0049    84            st          start2+1
001B C02F           004B    85            ld          read2+1           and 1442 read IOCC,
001C 1008                   86            sla         8
001D D02D           004B    87            st          read2+1
001E C02E           004D    88            ld          start1+1          and 2501 start IOCC.
001F 1009                   89            sla         9
0020 D02C           004D    90            st          start1+1

0021 C003           0025    92            ld          addrst            Build store instruction.
0022 1008                   93            sla         8
0023 D001           0025    94            st          addrst
0024 782B           0050    95            ldea        80                Store column count in card buffer.
0025 D400 00C0      00C0    96   addrst   st       L  cardbuf
0025                0025    97            org         *-2
0025 00D4           00D4    98            dc          0x00D4            (Used to build store instruction.)
0027                0027    99            org         *+1
0027 D0DA           0002   100            st          xr2               Also store as program load address.

0028 081F           0048   102   read     xio         start2            Start both card readers.
0029 0822           004C   103            xio         start1
002A 3000                  104            wait         

                           106   * This is the operation complete interrupt handler for both card readers.

002B 0000                  108   compint  entry        
002C 1010                  109            clr                           Set column index to zero.
002D D0D3           0001   110            st          xr1

                    002E   112   pack     equ         *                 Packing loop:
002E C500 00C1      00C1   113   packld   ld       L1 cardbuf+1         Load next column from card buffer.
002E                002E   114            org         *-2
002E 00C5           00C5   115            dc          0x00C5
0030                0030   116            org         *+1
0030 1808                  117            sra         8
0031 ED00 00C2      00C2   118   packor   or       L1 cardbuf+2         OR in column after that one.
0031                0031   119            org         *-2
0031 00ED           00ED   120            dc          0x00ED
0033                0033   121            org         *+1
0033 D200           0000   122   packst   st        2 0                 Store in program being loaded.
0033                0033   123            org         *-1
0033 00D2           00D2   124            dc          0x00D2

23 Jun 2011 13:58                              IBM 1130 Assembler E  v0.9                                        4
iplboot.asm                                       IPL Bootstrap Loader                              

Loc. Object code    Expr. Line   Statement

0034 C0CD           0002   125            ld          xr2               Increment program load address.
0035 5001                  126            inca         
0036 D0CB           0002   127            st          xr2
0037 C0C9           0001   128            ld          xr1               Pick up column index,
0038 5002                  129            mda         2                 advance by 2,
0039 D0C7           0001   130            st          xr1               and save.
003A B0CE           0009   131            cmp         colct             Have we packed all columns?
003B 4838                  132            skp                           Yes.
003C 70F1           002E   133            jmp         pack              No, do another.

003D 7012           0050   135            jmp         next              Continue with second card of loader.

                           137   * This is the 1442 column interrupt handler.

003E 0000                  139   colint   entry        
003F 08CA           000A   140            xio         sense2            Reset the 1442.
0040 C009           004A   141            ld          read2             Increment the column read address.
0041 5001                  142            inca         
0042 D007           004A   143            st          read2
0043 0806           004A   144            xio         read2             Read the column.
0044 4878                  145            bosc        -Z+               Clear the interrupt.
0044                0044   146            org         *-1
0044 48F8           48F8   147            dc          0x48F8            (Harmless to have indirect bit on.)
0045 1000                  148            nop          
0046 3000                  149            wait                          Wait for next column.

0048 0000 1404      0000   151   start2   iocc        0,dev@1442,iof@ctl,c2@read
0049                0049   152            org         *-1
0049 2808           2808   153            dc          (dev@1442 .< 12)+(iof@ctl .< 9)+(c2@read .< 1)
004A 00C0 1200      00C0   154   read2    iocc        cardbuf,dev@1442,iof@rd
004B                004B   155            org         *-1
004B 0012           0012   156            dc          (dev@1442 .< 3)+iof@rd
004C 00C0 4E00      00C0   157   start1   iocc        cardbuf,dev@2501,iof@ird
004D                004D   158            org         *-1
004D 0027           0027   159            dc          (dev@2501 .< 2)+(iof@ird .> 1)
004E 0000 4F01      0000   160   sense1   iocc        0,dev@2501,iof@dsw,c1@reset
004F                004F   161            org         *-1
004F 3800           3800   162            dc          0x3800            (Added to sense2+1 to get word.)

                           164            assert      (* <= 80)

23 Jun 2011 13:58                              IBM 1130 Assembler E  v0.9                                        5
iplboot.asm                                       IPL Bootstrap Loader                              

Loc. Object code    Expr. Line   Statement

                           166   * This is the second card of the bootstrap loader, which is in 72-column
                           167   * 1800 format.

0050                0050   169            org         80

                    0050   171   next     equ         *
0050 08B9           000A   172            xio         sense2            Reset both card readers.
0051 08FC           004E   173            xio         sense1
0052 4C40 0054      0054   174            bosc     L  *                 Clear the interrupt.

0054 C400 010D      010D   176            ld       L  cardbuf+1+76      Check the sequence number to see if
0056 EC00 010E      010E   177            or       L  cardbuf+1+77      it's 9999.
0058 EC00 010F      010F   178            or       L  cardbuf+1+78
005A EC00 0110      0110   179            or       L  cardbuf+1+79
005C B00F           006C   180            cmp         holl9
005D 7002           0060   181            jmp         reset             No.
005E 7001           0060   182            jmp         reset             No.
005F 7009           0069   183            jmp         invoke            Yes, invoke the program.

0060 785F           00C0   185   reset    ldea        cardbuf           Reset 1442 read IOCC address.
0061 D0E8           004A   186            st          read2

0062 7C00 1C00             188            ldimm       bootaddr          Reset XR2 to point to the program
0064 B09D           0002   189            cmp         xr2               load address if we just read the
0065 7001           0067   190            jmp         reset2            second card of the bootstrap loader.
0066 4838                  191            skp          
0067 5200                  192   reset2   ldxa      2 0

0068 70BF           0028   194            jmp         read              Read the next card.

                           196   * Invoke the loaded program by branching indirect through its first word.
                           197   * The Acc is nonzero for the 1442, zero for the 2501.

0069 C0D4           003E   199   invoke   ld          colint            
006A 4CB8 1C00      1C00   200            b        I  bootaddr

006C 0010                  202   holl9    dtext     H "9"

                           204            assert      (* <= 80+36)

                           206   * Position the card buffer so its address has bits 8 and 9 both on.

23 Jun 2011 13:58                              IBM 1130 Assembler E  v0.9                                        6
iplboot.asm                                       IPL Bootstrap Loader                              

Loc. Object code    Expr. Line   Statement


                    00C0   208   cardbuf  equ         0x00C0

23 Jun 2011 13:58                              IBM 1130 Assembler E  v0.9                                        7
iplboot.asm                                           Macro Table                                   

Library    Line   Name      Lines  Calls

os           31   bootitem      5      1
system      173   dev1442      18      1
system      204   dev2501      10      1
system       78   devcode      34      1
system      125   iofunc       10      1
system       34   lowmem       30      1

23 Jun 2011 13:58                              IBM 1130 Assembler E  v0.9                                        8
iplboot.asm                                           Symbol Table                                  

Line        Symbol     Value   Attributes

   0        $debug     0001    
   0        $false     0000    
   0        $true      0001    
   0        $verbose   0001    
  96        addrst     0025    
  38.1      bootaddr   1C00    
  37.6      c1@busy    000E    
  37.5      c1@cmplt   0004    
  37.3      c1@error   0002    
  37.4      c1@last    0003    
  37.7      c1@nrdy    000F    
  37.1      c1@reset   0001    
  36.14     c2@busy    000E    
  36.13     c2@check   0007    
  36.12     c2@cmplt   0004    
  36.10     c2@error   0002    
  36.3      c2@feed    0002    
  36.11     c2@last    0003    
  36.15     c2@nrdy    000F    
  36.9      c2@presp   0001    
  36.2      c2@punch   0001    
  36.4      c2@read    0004    
  36.8      c2@rresp   0000    
  36.5      c2@rset0   0001    
  36.6      c2@rset4   0002    
  36.1      c2@sel     0080    
 208        cardbuf    00C0    
  38.2      cciaddr    0030    
  59        colct      0009    
 139        colint     003E    entry
 108        compint    002B    entry
  34.6      dev@1132   0006    
  34.3      dev@1134   0003    
  34.8      dev@1231   0008    
  34.17     dev@1403   0015    
  34.2      dev@1442   0002    
  34.5      dev@1627   0005    
  34.21     dev@2250   0019    
  34.9      dev@2501   0009    
  34.7      dev@ces    0007    
  34.11     dev@clk    000B    

23 Jun 2011 13:58                              IBM 1130 Assembler E  v0.9                                        9
iplboot.asm                                           Symbol Table                                  

Line        Symbol     Value   Attributes

  34.1      dev@con    0001    
  34.4      dev@dk0    0004    
  34.13     dev@dk1    0011    
  34.26     dev@dk10   0004    
  34.14     dev@dk2    0012    
  34.15     dev@dk3    0013    
  34.16     dev@dk4    0014    
  34.18     dev@dk5    0016    
  34.19     dev@dk6    0017    
  34.23     dev@dk7    0001    
  34.24     dev@dk8    0002    
  34.25     dev@dk9    0003    
  34.10     dev@sca    000A    
  34.12     dev@sys7   000C    
  34.20     dev@tape   0018    
  34.28     dev@tp0    0000    
  34.29     dev@tp1    0001    
  34.30     dev@tp2    0002    
  34.31     dev@tp3    0003    
 202        holl9      006C    
  70        init2      000D    
 199        invoke     0069    
  35.4      iof@ctl    0004    
  35.7      iof@dsw    0007    
  35.3      iof@ilsw   0003    
  35.6      iof@ird    0006    
  35.5      iof@iwrt   0005    
  35.2      iof@rd     0002    
  35.1      iof@wrt    0001    
  33.11     lm$clock   0005    
  33.15     lm$int0    0008    
  33.16     lm$int1    0009    
  33.17     lm$int2    000A    
  33.18     lm$int3    000B    
  33.19     lm$int4    000C    
  33.20     lm$int5    000D    
  33.23     lm$scan    0020    
  33.12     lm$timer   0006    
  33.10     lm$tvec    0004    
  33.7      lm$xr1     0001    
  33.8      lm$xr2     0002    

23 Jun 2011 13:58                              IBM 1130 Assembler E  v0.9                                       10
iplboot.asm                                           Symbol Table                                  

Line        Symbol     Value   Attributes

  33.9      lm$xr3     0003    
  33.6      lm$zero    0000    
 171        next       0050    
 112        pack       002E    
 113        packld     002E    
 118        packor     0031    
 122        packst     0033    
 102        read       0028    
 154        read2      004A    
 185        reset      0060    
 192        reset2     0067    
 160        sense1     004E    
  62        sense2     000A    
 157        start1     004C    
 151        start2     0048    
   0        xr1        0001    
   0        xr2        0002    
   0        xr3        0003    
