The banner program packed over 8K words of numbers into just over 4K words. via ths method --
C PACK TWO SMALL INTS, 0-255, OF I(J) AND I(J+1)
C INTO A 16 BIT INTEGER ''K''
N=I(J)
M=1
IF(N-128)160,150,150
150 N=N-128
M=-1
160 K=(N*256+I(J+1))*M
FORTAN has rigid input as well. This is the the full program that read in all the numbers (either from cards or keyboard), doing a free form convert and punching back out the modified data in rigid form.
Maxium input was 1000 numbers (up to 50 cards), it was run many many times until the complete data deck was produced. The free from conversion is a kind of an atoi(), but is really a full line to integer array. This greatly speed up input of the data. Since the punched cards had no human readable text on top, they were then run thru the 029 keypunch in "interpret" mode to put that there.
Only some of the original data is shown for an example.
Write of data to the typewriter really slowed down punching. Also 'WRITE(2,), punching didn't work on the simulator.
I used a similar technique to add hex input/output to the 1130, see this hex sample
Here's some code size notes too.
// JOB T
// FOR
*LIST ALL
*IOCS(CARD,TYPEWRITER,KEYBOARD,1132 PRINTER)
*ONE WORD INTEGERS
INTEGER DECC(10),DECD(10),INPUT(72),IVAL(72),OUT(500)
INTEGER HLD(1000),H1(500),H2(500),PARSE(73),OIDX
EQUIVALENCE (PARSE(1), INPUT(1))
EQUIVALENCE (HLD(1), H1(1))
EQUIVALENCE (HLD(501), H2(1))
C MAKE SURE LAST CHAR IS NON NUMERIC
DATA PARSE/73*' '/
C ZERO-OUT HLD(1-1000)
DATA H1/500*0/
DATA H2/500*0/
C ZERO-OUT OUT(1-500)
DATA OUT/500*0/
DATA DECC/'0','1','2','3','4','5','6','7','8','9'/
DATA DECD/0,1,2,3,4,5,6,7,8,9/
DATA IDEV,IDX,ILN/6,0,0/
WRITE(1,1)
1 FORMAT('FLIP SWITCH 15 UP TO READ FROM CHARS NOT KYBRD'/
+'FLIP SWITCH 0 UP TO PRINT CARD IMAGE TO TYPEWRITER TOO'//
+'ENTER CARD ID START NUM, 1000 WILL BE ADDED FOR YOU')
READ(6,3)NCRD
3 FORMAT(I4)
NCRD=NCRD+1000
CALL DATSW(15,M)
GO TO (4,5), M
4 IDEV=2
GO TO 20
5 WRITE(1,6)
6 FORMAT('ENTER FREE FORM NUMBERS, SEPARATE BY ANY AMOUNT OF'/
+'NON-NUM CHARS, BLANK LINE/CARD TO EXIT, UP TO 72 CHARS')
20 READ(IDEV, 30) INPUT
30 FORMAT(72A1)
ILN=ILN+1
N=0
OIDX=IDX
DO 100 I=1,73
DO 50 K=1,10
IF(PARSE(I)-DECC(K))50,90,50
50 CONTINUE
IF(N)100,100,55
55 J=I-N
IN=0
DO 60 M=J,I
N=N-1
60 IN=IN+IVAL(M)*10**N
IF(IN-255)70,70,80
70 IDX=IDX+1
IF(IDX-1000)75,75,105
75 HLD(IDX)=IN
N=0
GO TO 100
80 WRITE(1, 85) ILN,INPUT
85 FORMAT('BAD DATA, SKIPPING INPUT LINE/CARD NO',I4/72A1)
GO TO 20
90 IVAL(I)=DECD(K)
N=N+1
100 CONTINUE
IF(IDX-OIDX)20,110,20
105 WRITE(1, 107) HLD(1000),ILN,INPUT
107 FORMAT('TOO MUCH, LAST NUM USED',I4,' AT LINE/CARD NO',I4/72A1)
110 OIDX=IDX+1
IDX=0
DO 200 J=1,OIDX,2
N=HLD(J)
M=1
IF(N-128)160,150,150
150 N=N-128
M=-1
160 K=(N*256+HLD(J+1))*M
IDX=IDX+1
200 OUT(IDX)=K
N=(IDX+9)/10
DO 300 I=1,N
IS=(I-1)*10+1
IE=IS+9
CALL DATSW(0, M)
GO TO (230, 240), M
230 WRITE(1, 250) (OUT(J),J=IS,IE), NCRD
240 WRITE(2, 250) (OUT(J),J=IS,IE), NCRD
250 FORMAT(10I7,' BANR',I4)
300 NCRD=NCRD+10
CALL EXIT
END
// XEQ
225 33 6 89 19 129 31 10 73 40 129 30 12 63 53 129
29 14 53 65 129 29 14 52 67 129 29 14 53 65 129 30
12 63 53 129 31 10 73 40 129 33 6 89 19 193 86 4
100 4 131 81 28 131 86 4 100 4 133 81 28 131 86 4
100 4 195 110 6 129 108 10 129 107 12 129 106 14 129
96 2 104 16 129 98 22 129 101 18 129 104 14 129
107 9
193 79 4 130 79 4 129 67 2 79 4 93 2 129 65 6 79
4 91 6 129 66 7 79 4 89 7 129 68 7 79 4 87 7 129
70 6 79 4 86 6 129 71 20 129 73 16 129 75 12 129 61
40 131 75 12 129 73 16 129 71 20 129 70 6 79 4 86 6
129 68 7 79 4 87 7 129 66 7 79 4 89 7 129 65 6 79
4 91 6 129 67 2 79 4 93 2 129 79 4 194 59 4 139 40
42 131 59 4 203 33 6 129 31 10 129 30 12 129 29 14