Google
 

Trailing-Edge - PDP-10 Archives - decuslib20-02 - decus/20-0026/adsam.smp
There are 2 other files named adsam.smp in the archive. Click here to see a list.
C                                                                       ADSA  10
C     ..................................................................ADSA  20
C                                                                       ADSA  30
C        SAMPLE MAIN PROGRAM FOR MATRIX ADDITION - ADSAM                ADSA  40
C                                                                       ADSA  50
C        PURPOSE                                                        ADSA  60
C           MATRIX ADDITION SAMPLE PROGRAM                              ADSA  70
C                                                                       ADSA  80
C        SUBROUTINES AND FUNCTION SUBPROGRAMS REQUIRED                  ADSA  90
C           MADD                                                        ADSA 100
C           MATIN                                                       ADSA 110
C           MXOUT                                                       ADSA 120
C           LOC                                                         ADSA 130
C                                                                       ADSA 140
C        METHOD                                                         ADSA 150
C           TWO INPUT MATRICES ARE READ FROM THE STANDARD INPUT DEVICE. ADSA 160
C           THEY ARE ADDED AND THE RESULTANT MATRIX IS LISTED ON        ADSA 170
C           THE STANDARD OUTPUT DEVICE. THIS CAN BE REPEATED FOR ANY    ADSA 180
C           NUMBER OF PAIRS OF MATRICES UNTIL A BLANK CARD IS           ADSA 190
C           ENCOUNTERED                                                 ADSA 200
C                                                                       ADSA 210
C     ..................................................................ADSA 220
C                                                                       ADSA 230
C        MATRICES ARE DIMENSIONED FOR 1000 ELEMENTS. THEREFORE, PRODUCT ADSA 240
C        OF NUMBER OF ROWS BY NUMBER OF COLUMNS CANNOT EXCEED 1000.     ADSA 250
C                                                                       ADSA 260
      DIMENSION A(1000),B(1000),R(1000)                                 ADSA 270
C                                                                       ADSA 280
   10 FORMAT(1H1,15HMATRIX ADDITION)                                    ADSA 290
   11 FORMAT(1H0,44HDIMENSIONED AREA TOO SMALL FOR INPUT MATRIX ,I4)    ADSA 300
   12 FORMAT(1H0,20HEXECUTION TERMINATED)                               ADSA 310
   13 FORMAT(1H0,32HMATRIX DIMENSIONS NOT CONSISTENT)                   ADSA 320
   14 FORMAT(1H0,42HINCORRECT NUMBER OF DATA CARDS FOR MATRIX ,I4)      ADSA 330
   15 FORMAT(1H0,18HGO ON TO NEXT CASE)                                 ADSA 340
   16 FORMAT(1H0,11HEND OF CASE)                                        ADSA 350
C                                                                       ADSA 360
C     ..................................................................ADSA 370
C                                                                       ADSA 380
      WRITE(6,10)                                                       ADSA 390
   20 CALL MATIN(ICODA,A,1000,NA,MA,MSA,IER)                            ADSA 400
      IF( NA ) 25,95,25                                                 ADSA 410
   25 IF(IER-1) 40,30,35                                                ADSA 420
   30 WRITE(6,11) ICODA                                                 ADSA 430
      GO TO 45                                                          ADSA 440
   35 WRITE(6,14) ICODA                                                 ADSA 450
   37 WRITE(6,12)                                                       ADSA 460
      GO TO 95                                                          ADSA 470
   40 CALL MXOUT(ICODA,A,NA,MA,MSA,60,120,2)                            ADSA 480
   45 CALL MATIN(ICODB,B,1000,NB,MB,MSB,IER)                            ADSA 490
      IF(IER-1) 60,50,55                                                ADSA 500
   50 WRITE(6,11) ICODB                                                 ADSA 510
      WRITE(6,15)                                                       ADSA 520
      GO TO 20                                                          ADSA 530
   55 WRITE(6,14) ICODB                                                 ADSA 540
      GO TO 37                                                          ADSA 550
   60 IF(NA-NB) 75,70,75                                                ADSA 560
   70 IF(MA-MB) 75,80,75                                                ADSA 570
   75 WRITE(6,13)                                                       ADSA 580
      WRITE(6,15)                                                       ADSA 590
      GO TO 20                                                          ADSA 600
   80 CALL MXOUT(ICODB,B,NB,MB,MSB,60,120,2)                            ADSA 610
      ICODR=ICODA+ICODB                                                 ADSA 620
      CALL MADD(A,B,R,NA,MA,MSA,MSB)                                    ADSA 630
      MSR=MSA                                                           ADSA 640
      IF(MSA-MSB) 90,90,85                                              ADSA 650
   85 MSR=MSB                                                           ADSA 660
   90 CALL MXOUT(ICODR,R,NA,MA,MSR,60,120,2)                            ADSA 670
      WRITE(6,16)                                                       ADSA 680
      GO TO 20                                                          ADSA 690
   95 RETURN                                                            ADSA 700
      END                                                               ADSA 710