-
Notifications
You must be signed in to change notification settings - Fork 0
/
palasm24.c
4391 lines (3876 loc) · 122 KB
/
palasm24.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* palasm24.f -- translated by f2c (version 12.02.01).
You must link the resulting object file with libf2c:
on Microsoft Windows system, link with libf2c.lib;
on Linux or Unix systems, link with .../path/to/libf2c.a -lm
or, if you install libf2c.a in a standard place, with -lf2c -lm
-- in that order, at the end of the command line, as in
cc *.o -lf2c -lm
Source for libf2c is in /netlib/f2c/libf2c.zip, e.g.,
http://www.netlib.org/f2c/libf2c.zip
*/
#include <stdlib.h> /* For exit() */
#include <f2c.h>
/* Common Block Declarations */
struct {
logical lblank, lleft, land, lor, lslash, lequal, lright, lxor;
} _BLNK__;
#define _BLNK__1 _BLNK__
struct {
integer ipage[16000] /* was [80][200] */;
} pge_;
#define pge_1 pge_
struct {
logical lfuses[3200] /* was [40][80] */, lphant[3200] /*
was [40][80] */;
} lfuses_;
#define lfuses_1 lfuses_
struct {
integer ifunct, idesc, iend;
} ftest_;
#define ftest_1 ftest_
struct {
integer pms, pof, pdf;
} lunit_;
#define lunit_1 lunit_
union {
struct {
integer ntest, tstvec;
} _1;
struct {
integer ntest, tstvec[1008] /* was [24][42] */;
} _2;
} tstvec_;
#define tstvec_1 (tstvec_._1)
#define tstvec_2 (tstvec_._2)
struct {
integer ipt;
} ipt_;
#define ipt_1 ipt_
struct {
integer isum[4], idec[4], ipbuf[40], bufio[40], nfuse;
} sum_;
#define sum_1 sum_
struct blk_1_ {
integer pr8x10[140] /* was [10][14] */, prod8[88] /* was [8][11] */,
prodln[280] /* was [40][7] */;
};
#define blk_1 (*(struct blk_1_ *) &blk_)
/* Initialized data */
struct {
integer e_1[228];
char e_2[1120];
} blk_ = { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 3, 6, 5, 5, 5, 5, 5, 5, 6, 3, 3,
3, 7, 7, 8, 8, 7, 7, 3, 3, 3, 3, 3, 9, 10, 10, 9, 3, 3, 3, 3, 3,
3, 3, 1, 1, 3, 3, 3, 3, 2, 2, 2, 2, 1, 1, 3, 3, 3, 3, 11, 11, 11,
11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
11, 11, 11, 11, 11, 3, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 1, 1, 1, 1,
1, 1, 1, 1, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 1, 1, 1, 1, 1, 1,
1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3,
3, 3, 3, 3, 3, 4, 4, 3, 3, 3, 3, 3, 3, 5, 5, 3, 3, 3, 3, 3, 3, 5,
5, 5, 5, 3, 3, 3, 3, 6, 6, 6, 6, 3, 3, 3, 3, 6, 6, 3, 3, 3, 3, 3,
3, 7, 7, 7, 7, 7, 7, 3, 3, 7, 7, 7, 7, 3, 3, 3, 3, 1, 1, 1, 1, 3,
3, 3, 3, "X X X X X X X X X X X X X X "
" X X X X X X X X X X X X X X X X "
" X X X X X X X X X X P P P P P P "
" P P P P P P P P P P P P P P P P "
" P P P P P P P P P P P P P P P P "
" P P N N N N N N N N N N N N N N "
" N N N N N N N N N N N N N N N N "
" N N N N N N N N N N X X X X X X "
" P P X X P P X X P P X X P P X X "
" P P X X P P X X P P X X P P X X "
" X X X X X X X X X X X X P P X X "
" P P X X P P X X P P X X P P X X "
" P P X X X X X X X X X X X X X X "
" X X X X X X X X P P X X P P X X "
" P P X X P P X X X X X X X X X X "
" X X X X X X X X X X X X X X X X "
" X X X X P P X X P P X X X X X X "
" X X X X X X X X X X " };
/* Table of constant values */
static integer c__1 = 1;
static integer c__3 = 3;
static integer c__5 = 5;
static integer c__72 = 72;
static integer c__80 = 80;
static logical c_false = FALSE_;
static logical c_true = TRUE_;
static integer c__40 = 40;
static integer c__64 = 64;
static integer c__4 = 4;
static integer c__10 = 10;
static integer c__50 = 50;
/* **PALASM24**PALASM24**PALASM24**PALASM24**PALASM24**PALASM24**PALASM24* */
/* P A L A S M 2 4 - TRANSLATES SYMBOLIC EQUATIONS INTO PAL OBJECT */
/* CODE FORMATTED FOR DIRECT INPUT TO STANDARD */
/* PROM AND PAL PROGRAMMERS. */
/* REV LEVEL: VERSION 1.6C (08/16/83) */
/* (C) COPYRIGHT 1983 MONOLITHIC MEMORIES */
/* *********************************************** */
/* * * */
/* * APPROVAL * */
/* * * */
/* * * */
/* * 1: JOHN BIRKNER * */
/* * * */
/* * PROGRAMMABLE LOGIC PLANNER * */
/* * * */
/* * * */
/* * 2: VINCENT COLI * */
/* * * */
/* * APPLICATIONS ENGINEER * */
/* * * */
/* * * */
/* * 3: MANOUCHEHR VAFAI * */
/* * * */
/* * APPLICATIONS ENGINEER * */
/* * * */
/* * * */
/* *********************************************** */
/* INPUT: PAL DESIGN SPECIFICATION ASSIGNED */
/* TO RPD(1). OPERATION CODES ARE */
/* ASSIGNED TO ROP(5). */
/* OUTPUT: ECHO, SIMULATION, AND FUSE PATTERN */
/* ARE ASSIGNED TO POF(6). JEDEC, HEX, */
/* AND BINARY PROGRAMMING FORMATS ARE */
/* ASSIGNED TO PDF(6). PROMPTS AND */
/* ERROR MESSAGES ARE ASSIGNED TO */
/* PMS(6). */
/* PART NUMBER: THE PAL PART NUMBER MUST APPEAR */
/* IN COLUMN ONE OF LINE ONE. */
/* PIN LIST: 24 SYMBOLIC PIN NAMES MUST APPEAR */
/* STARTING ON LINE FIVE. */
/* EQUATIONS: STARTING FIRST LINE AFTER THE */
/* PIN LIST IN THE FOLLOWING FORMS: */
/* A = B*C + D */
/* A := B*C + D */
/* IF( A*B ) C = D + E */
/* ALL CHARACTERS FOLLOWING ';' ARE */
/* IGNORED UNTIL THE NEXT LINE. */
/* BLANKS ARE IGNORED. */
/* OPERATORS: ( IN HIERARCHY OF EVALUATION ) */
/* ; COMMENT FOLLOWS */
/* / COMPLEMENT */
/* * AND (PRODUCT) */
/* + OR (SUM) */
/* :+: XOR (EXCLUSIVE OR) */
/* ( ) CONDITIONAL THREE-STATE */
/* = EQUALITY */
/* := REPLACED BY (AFTER CLOCK) */
/* FUNCTION L, H, X, Z, AND C ARE VALID */
/* TABLE: FUNCTION TABLE VECTOR ENTRIES. */
/* REFERENCE: A COMPLETE USERS GUIDE TO */
/* DESIGNING WITH PALS USING PALASM */
/* IS PROVIDED IN THE MONOLITHIC */
/* MEMORIES PAL HANDBOOK. */
/* SUBROUTINES: INITLZ,GETSYM,INCR,MATCH,IXLATE, */
/* ECHO,CAT,PINOUT,PLOT,PLOTF,SUMCHK */
/* ICONV,HEX,SUMCHK,TWEEK,BINR,SLIP, */
/* FANTOM,IODC2,IODC4,TEST,INTEL */
/* AUTHORS: JOHN BIRKNER AND VINCENT COLI */
/* FAULT TESTING BY IMTIYAZ BENGALI */
/* REVISED JEDEC FORMAT BY MANO VAFAI */
/* MONOLITHIC MEMORIES INC. */
/* 1165 EAST ARQUES AVENUE */
/* SUNNYVALE, CALIFORNIA 94043 */
/* (408) 739-3535 */
/* FINE PRINT: MONOLITHIC MEMORIES TAKES NO */
/* RESPONSIBILITY FOR THE OPERATION */
/* OR MAINTENANCE OF THIS PROGRAM. */
/* THE SOURCE CODE AS PRINTED HERE */
/* PRODUCED THE OBJECT CODE OF THE */
/* EXAMPLES IN THE APPLICATIONS */
/* SECTION ON A VAX/VMS 11/780 */
/* COMPUTER WITH FORTRAN 77 AND A */
/* NATIONAL CSS IBM SYSTEM/370 */
/* WITH FORTRAN IV (LEVEL G). */
/* *********************************************************************** */
/* MAIN PROGRAM */
/* Actual main program */
int main(int argc, char **argv)
{
extern int MAIN__();
libf2c_init(argc, argv);
MAIN__();
libf2c_close();
exit(0);
return 0;
}
/* Main program */
int MAIN__(void)
{
/* Initialized data */
static struct {
char e_1[4];
integer e_2;
} equiv_97 = { "E ", 0 };
#define e (*(integer *)&equiv_97)
static struct {
char e_1[4];
integer e_2;
} equiv_98 = { "N ", 0 };
#define n (*(integer *)&equiv_98)
static struct {
char e_1[4];
integer e_2;
} equiv_99 = { "C ", 0 };
#define c__ (*(integer *)&equiv_99)
static struct {
char e_1[4];
integer e_2;
} equiv_100 = { "Q ", 0 };
#define q (*(integer *)&equiv_100)
static struct {
char e_1[4];
integer e_2;
} equiv_101 = { "F ", 0 };
#define f (*(integer *)&equiv_101)
static struct {
char e_1[4];
integer e_2;
} equiv_102 = { "B ", 0 };
#define bb (*(integer *)&equiv_102)
static struct {
char e_1[4];
integer e_2;
} equiv_103 = { "C ", 0 };
#define cc (*(integer *)&equiv_103)
static struct {
char e_1[4];
integer e_2;
} equiv_104 = { "D ", 0 };
#define dd (*(integer *)&equiv_104)
static struct {
char e_1[4];
integer e_2;
} equiv_105 = { "E ", 0 };
#define ee (*(integer *)&equiv_105)
static struct {
char e_1[4];
integer e_2;
} equiv_106 = { "O ", 0 };
#define o (*(integer *)&equiv_106)
static struct {
char e_1[4];
integer e_2;
} equiv_107 = { "F ", 0 };
#define ff (*(integer *)&equiv_107)
static struct {
char e_1[4];
integer e_2;
} equiv_108 = { "I ", 0 };
#define ii (*(integer *)&equiv_108)
static struct {
char e_1[4];
integer e_2;
} equiv_109 = { "N ", 0 };
#define nn (*(integer *)&equiv_109)
static struct {
char e_1[4];
integer e_2;
} equiv_110 = { "O ", 0 };
#define oo (*(integer *)&equiv_110)
static struct {
char e_1[4];
integer e_2;
} equiv_111 = { "P ", 0 };
#define pp (*(integer *)&equiv_111)
static struct {
char e_1[4];
integer e_2;
} equiv_112 = { "R ", 0 };
#define rr (*(integer *)&equiv_112)
static struct {
char e_1[4];
integer e_2;
} equiv_113 = { "S ", 0 };
#define ss (*(integer *)&equiv_113)
static struct {
char e_1[4];
integer e_2;
} equiv_114 = { "T ", 0 };
#define tt (*(integer *)&equiv_114)
static struct {
char e_1[4];
integer e_2;
} equiv_115 = { "U ", 0 };
#define uu (*(integer *)&equiv_115)
static struct {
char e_1[4];
integer e_2;
} equiv_116 = { "J ", 0 };
#define jj (*(integer *)&equiv_116)
static struct {
char e_1[4];
integer e_2;
} equiv_117 = { "T ", 0 };
#define t (*(integer *)&equiv_117)
static integer bel = 7;
static struct {
char e_1[4];
integer e_2;
} equiv_118 = { "P ", 0 };
#define p (*(integer *)&equiv_118)
static struct {
char e_1[4];
integer e_2;
} equiv_119 = { "B ", 0 };
#define b (*(integer *)&equiv_119)
static struct {
char e_1[4];
integer e_2;
} equiv_120 = { "H ", 0 };
#define h__ (*(integer *)&equiv_120)
static struct {
char e_1[4];
integer e_2;
} equiv_121 = { "S ", 0 };
#define s (*(integer *)&equiv_121)
static struct {
char e_1[4];
integer e_2;
} equiv_122 = { "L ", 0 };
#define l (*(integer *)&equiv_122)
/* Format strings */
static char fmt_3[] = "(/,\002 MONOLITHIC MEMORIES 24-PIN PALASM VERSION"
" 1.6C\002)";
static char fmt_31[] = "(\002 (C) COPYRIGHT 1983 MONOLITHIC MEMORIES\002)"
;
static char fmt_1[] = "(/,\002 WHAT IS THE LOGICAL UNIT NUMBER FOR OUTPU"
"T(6)?: \002$)";
static char fmt_2[] = "(i4)";
static char fmt_10[] = "(3a1,5a1,72a1,/,80a1,/,80a1,/,80a1)";
static char fmt_11[] = "(80a1)";
static char fmt_18[] = "(/,\002 PAL PART TYPE \002,3a1,5a1,\002 IS INCOR"
"RECT\002)";
static char fmt_23[] = "(/,\002 LESS THAN 24 PIN NAMES IN PIN LIST\002)";
static char fmt_99[] = "(\002 \002,a1)";
static char fmt_101[] = "(/,\002 ERROR SYMBOL = \002,8a1,\002 IN L"
"INE NUMBER \002,i3,/,\002 \002,80a1)";
static char fmt_103[] = "(\002 OUTPUT MUST BE INVERTED SINCE \002,3a1,5a"
"1,\002 IS AN ACTIVE LOW DEVICE\002)";
static char fmt_105[] = "(\002 THIS PIN, NUMBER \002,i2,\002 IS AN INVAL"
"ID OUTPUT PIN\002,\002 FOR \002,3a1,5a1)";
static char fmt_115[] = "(\002 THIS PIN NUMBER \002,i2,\002 IS AN INVALI"
"D INPUT PIN\002,\002 FOR \002,3a1,5a1)";
static char fmt_106[] = "(/,\002 OPERATION CODES:\002)";
static char fmt_107[] = "(/,\002 E=ECHO INPUT O=PINOUT T=SIMULATE F=F"
"AULT TEST\002,/,\002 P=PLOT B=BRIEF J=JEDEC FORMAT H=HEX S=S"
"HORT\002,/,\002 L=BHLF N=BNPF I=INTEL FORMAT C=CATALOG Q=QUIT"
"\002)";
static char fmt_110[] = "(/,\002 ENTER OPERATION CODE: \002,$)";
static char fmt_120[] = "(a1)";
static char fmt_125[] = "(\0021\002)";
static char fmt_220[] = "(/,\002 NUMBER OF STUCK AT ONE (SA1) FAULTS AR"
"E =\002,i3)";
static char fmt_225[] = "(/,\002 NUMBER OF STUCK AT ZERO (SA0) FAULTS AR"
"E =\002,i3)";
static char fmt_230[] = "(/,\002 PRODUCT TERM COVERAGE "
" =\002i4,\002%\002,/)";
/* System generated locals */
integer i__1;
logical L__1;
/* Local variables */
static integer i__, j, ic, il;
extern /* Subroutine */ int cat_(void);
static integer ile, ill, roc, rpd, iop;
extern /* Subroutine */ int hex_(logical *, integer *);
static integer iot, lun, isa0, isa1;
static logical lsa01, lsa11;
extern /* Subroutine */ int echo_(integer *, integer *, integer *,
integer *, integer *, integer *);
static logical lact;
static integer isaf, ipal[3], ibuf[192] /* was [8][24] */;
static logical lbuf[24];
extern /* Subroutine */ int binr_(logical *, integer *, integer *), incr_(
integer *, integer *);
static integer comp[80];
static logical linp, lerr;
extern /* Subroutine */ int slip_(logical *, integer *, integer *,
integer *), sub_exit(void);
static integer rest[72];
extern /* Subroutine */ int plot_(), test_();
static integer isym[192] /* was [8][24] */, i8pro, iname[5];
extern /* Subroutine */ int match_(integer *, integer *, integer *);
static logical lsame;
extern /* Subroutine */ int intel_(logical *, integer *);
static integer iblow, iprod, ilerr;
static logical lprod[80];
static integer title[80], ipctr;
extern /* Subroutine */ int tweek_(integer *, logical *, logical *),
plotf_(integer *, integer *);
static integer i88pro, itype, ipctr0, ipctr1, imatch;
static logical lphase[24];
static integer ifault;
extern /* Subroutine */ int ixlate_(integer *, logical *, integer *,
logical *, integer *);
static logical lfirst;
static integer patnum[80];
static logical loperr;
extern /* Subroutine */ int getsym_(logical *, integer *, integer *,
integer *, integer *), initlz_(integer *, integer *, logical *,
logical *, integer *, integer *, integer *, integer *);
static integer iinput;
extern /* Subroutine */ int pinout_(integer *, integer *, integer *);
/* Fortran I/O blocks */
static cilist io___31 = { 0, 6, 0, fmt_3, 0 };
static cilist io___32 = { 0, 6, 0, fmt_31, 0 };
static cilist io___33 = { 0, 6, 0, fmt_1, 0 };
static cilist io___34 = { 0, 5, 0, fmt_2, 0 };
static cilist io___41 = { 0, 0, 0, fmt_10, 0 };
static cilist io___49 = { 0, 0, 1, fmt_11, 0 };
static cilist io___56 = { 0, 0, 0, fmt_18, 0 };
static cilist io___59 = { 0, 0, 0, fmt_23, 0 };
static cilist io___74 = { 0, 0, 0, fmt_99, 0 };
static cilist io___75 = { 0, 0, 0, fmt_101, 0 };
static cilist io___76 = { 0, 0, 0, fmt_103, 0 };
static cilist io___77 = { 0, 0, 0, fmt_105, 0 };
static cilist io___78 = { 0, 0, 0, fmt_115, 0 };
static cilist io___79 = { 0, 6, 0, fmt_106, 0 };
static cilist io___80 = { 0, 6, 0, fmt_107, 0 };
static cilist io___81 = { 0, 6, 0, fmt_110, 0 };
static cilist io___82 = { 0, 0, 0, fmt_120, 0 };
static cilist io___83 = { 0, 0, 0, fmt_125, 0 };
static cilist io___94 = { 0, 0, 0, fmt_220, 0 };
static cilist io___95 = { 0, 0, 0, fmt_225, 0 };
static cilist io___96 = { 0, 0, 0, fmt_230, 0 };
/* ASSIGNMENT OF DATA SET REFERENCES */
/* RPD - PAL DESIGN SPECIFICATION (INPUT) */
/* ROC - OPERATION CODE (INPUT) */
/* POF - ECHO, PINOUT, TEST, AND PLOT (OUTPUT) */
/* PDF - JEDEC, HEX, AND BINARY PROGRAMMING FORMATS (OUTPUT) */
/* PMS - PROMPTS AND ERROR MESSAGES (OUTPUT) */
s_wsfe(&io___31);
e_wsfe();
s_wsfe(&io___32);
e_wsfe();
s_wsfe(&io___33);
e_wsfe();
s_rsfe(&io___34);
do_fio(&c__1, (char *)&lun, (ftnlen)sizeof(integer));
e_rsfe();
rpd = 1;
roc = 5;
lunit_1.pof = lun;
lunit_1.pdf = lun;
lunit_1.pms = lun;
ftest_1.ifunct = 0;
ftest_1.idesc = 0;
/* INITIALIZE LSAME AND LACT TO FALSE (ACTIVE HIGH/LOW ERROR) */
lsame = FALSE_;
lact = FALSE_;
/* INITIALIZE LOPERR TO FALSE (OUTPUT PIN ERROR) */
loperr = FALSE_;
/* READ IN FIRST 4 LINES OF PAL DESIGN SPECIFICATION */
io___41.ciunit = rpd;
s_rsfe(&io___41);
do_fio(&c__3, (char *)&ipal[0], (ftnlen)sizeof(integer));
do_fio(&c__5, (char *)&iname[0], (ftnlen)sizeof(integer));
do_fio(&c__72, (char *)&rest[0], (ftnlen)sizeof(integer));
do_fio(&c__80, (char *)&patnum[0], (ftnlen)sizeof(integer));
do_fio(&c__80, (char *)&title[0], (ftnlen)sizeof(integer));
do_fio(&c__80, (char *)&comp[0], (ftnlen)sizeof(integer));
e_rsfe();
/* READ IN PIN LIST (LINE 5) THROUGH THE END OF THE PAL DESIGN */
/* SPECIFICATION */
for (j = 1; j <= 200; ++j) {
io___49.ciunit = rpd;
i__1 = s_rsfe(&io___49);
if (i__1 != 0) {
goto L16;
}
for (i__ = 1; i__ <= 80; ++i__) {
i__1 = do_fio(&c__1, (char *)&pge_1.ipage[i__ + j * 80 - 81], (
ftnlen)sizeof(integer));
if (i__1 != 0) {
goto L16;
}
}
i__1 = e_rsfe();
if (i__1 != 0) {
goto L16;
}
/* CHECK FOR 'FUNCTION TABLE' AND SAVE ITS LINE NUMBER */
if (ftest_1.ifunct == 0 && pge_1.ipage[j * 80 - 80] == ff &&
pge_1.ipage[j * 80 - 79] == uu && pge_1.ipage[j * 80 - 78] ==
nn && pge_1.ipage[j * 80 - 77] == cc && pge_1.ipage[j * 80 -
76] == tt && pge_1.ipage[j * 80 - 75] == ii && pge_1.ipage[j *
80 - 74] == oo && pge_1.ipage[j * 80 - 73] == nn &&
pge_1.ipage[j * 80 - 71] == tt && pge_1.ipage[j * 80 - 69] ==
bb && pge_1.ipage[j * 80 - 67] == ee) {
ftest_1.ifunct = j;
}
/* CHECK FOR 'DESCRIPTION' AND SAVE ITS LINE NUMBER */
if (ftest_1.idesc == 0 && pge_1.ipage[j * 80 - 80] == dd &&
pge_1.ipage[j * 80 - 79] == ee && pge_1.ipage[j * 80 - 78] ==
ss && pge_1.ipage[j * 80 - 77] == cc && pge_1.ipage[j * 80 -
76] == rr && pge_1.ipage[j * 80 - 75] == ii && pge_1.ipage[j *
80 - 74] == pp && pge_1.ipage[j * 80 - 73] == tt &&
pge_1.ipage[j * 80 - 72] == ii && pge_1.ipage[j * 80 - 71] ==
oo && pge_1.ipage[j * 80 - 70] == nn) {
ftest_1.idesc = j;
}
/* L15: */
}
/* SAVE THE LAST LINE NUMBER OF THE PAL DESIGN SPECIFICATION */
L16:
ftest_1.iend = j - 1;
initlz_(iname, &itype, lfuses_1.lfuses, lfuses_1.lphant, &ic, &il, &iblow,
&ipctr);
/* PRINT ERROR MESSAGE FOR INVALID PAL PART TYPE */
if (itype != 0) {
goto L17;
}
io___56.ciunit = lunit_1.pms;
s_wsfe(&io___56);
do_fio(&c__3, (char *)&ipal[0], (ftnlen)sizeof(integer));
do_fio(&c__5, (char *)&iname[0], (ftnlen)sizeof(integer));
e_wsfe();
sub_exit();
/* GET 24 PIN NAMES */
L17:
for (j = 1; j <= 24; ++j) {
/* L20: */
getsym_(lphase, isym, &j, &ic, &il);
}
if (! (_BLNK__1.lequal || _BLNK__1.lleft || _BLNK__1.land || _BLNK__1.lor
|| _BLNK__1.lright)) {
goto L24;
}
io___59.ciunit = lunit_1.pms;
s_wsfe(&io___59);
e_wsfe();
sub_exit();
L24:
ile = il;
/* BYPASS FUSE PLOT ASSEMBLY IF HAL ('H' IN LINE 1, COLUMN 1) */
if (ipal[0] == h__) {
goto L108;
}
L25:
getsym_(lbuf, ibuf, &c__1, &ic, &il);
L28:
if (! _BLNK__1.lequal) {
goto L25;
}
ill = il;
match_(&imatch, ibuf, isym);
if (imatch == 0) {
goto L100;
}
/* CHECK FOR VALID POLARITY (ACTIVE LOW) */
lsame = lphase[imatch - 1] && lbuf[0] || ! lphase[imatch - 1] && ! lbuf[0]
;
if (itype != 6 && lsame) {
lact = TRUE_;
}
/* CHECK FOR VALID OUTPUT PIN */
/* L29: */
if ((itype == 1 || itype == 7 || itype == 8 || itype == 9 || itype == 10)
&& (imatch < 14 || imatch > 23)) {
loperr = TRUE_;
}
if ((itype == 2 || itype == 11 || itype == 12 || itype == 13 || itype ==
14) && (imatch < 15 || imatch > 22)) {
loperr = TRUE_;
}
if (itype == 3 && (imatch < 16 || imatch > 21)) {
loperr = TRUE_;
}
if (itype == 4 && (imatch < 17 || imatch > 20)) {
loperr = TRUE_;
}
if ((itype == 5 || itype == 6) && (imatch < 18 || imatch > 19)) {
loperr = TRUE_;
}
if (lact || loperr) {
goto L100;
}
i88pro = (23 - imatch << 3) + 1;
/* START PAL20C1 ON PRODUCT LINE 32 (I88PRO=33) */
if (iname[2] == c__) {
i88pro = 33;
}
ic = 0;
L30:
incr_(&ic, &il);
if (! (_BLNK__1.lequal || _BLNK__1.lleft)) {
goto L30;
}
lprod[i88pro - 1] = TRUE_;
if (! _BLNK__1.lleft) {
slip_(lfuses_1.lfuses, &i88pro, &itype, &iblow);
}
for (i8pro = 1; i8pro <= 16; ++i8pro) {
if (_BLNK__1.lxor && i8pro != 3) {
goto L70;
}
iprod = i88pro + i8pro - 1;
lprod[iprod - 1] = TRUE_;
lfirst = TRUE_;
L50:
ill = il;
getsym_(lbuf, ibuf, &c__1, &ic, &il);
match_(&imatch, ibuf, isym);
/* CHECK FOR INVALID INPUT PIN */
if (itype == 1 && (imatch >= 14 && imatch <= 23)) {
linp = TRUE_;
}
if (itype == 2 && (imatch >= 15 && imatch <= 22)) {
linp = TRUE_;
}
if (itype == 3 && (imatch >= 16 && imatch <= 21)) {
linp = TRUE_;
}
if (itype == 4 && (imatch >= 17 && imatch <= 20)) {
linp = TRUE_;
}
if (itype == 5 && (imatch == 18 || imatch == 19)) {
linp = TRUE_;
}
if (itype == 6 && (imatch == 18 || imatch == 19)) {
linp = TRUE_;
}
if (itype == 7 && (imatch == 14 || imatch == 23)) {
linp = TRUE_;
}
if ((real) itype == 8.f && (imatch == 1 || imatch == 13)) {
linp = TRUE_;
}
if ((real) itype == 9.f && (imatch == 1 || imatch == 13)) {
linp = TRUE_;
}
if ((real) itype == 10.f && (imatch == 1 || imatch == 13)) {
linp = TRUE_;
}
if (itype == 11 && (imatch == 15 || imatch == 22)) {
linp = TRUE_;
}
if (itype >= 12 && (imatch == 1 || imatch == 13)) {
linp = TRUE_;
}
ill = il;
if (linp) {
goto L100;
}
if (imatch == 0) {
goto L100;
}
if (imatch == 12) {
goto L64;
}
if (! lfirst) {
goto L58;
}
lfirst = FALSE_;
for (i__ = 1; i__ <= 40; ++i__) {
++iblow;
/* L56: */
lfuses_1.lfuses[i__ + iprod * 40 - 41] = TRUE_;
}
L58:
ixlate_(&iinput, lphase, &imatch, lbuf, &itype);
if (iinput <= 0) {
goto L60;
}
--iblow;
lfuses_1.lfuses[iinput + iprod * 40 - 41] = FALSE_;
plot_(lbuf, ibuf, lfuses_1.lfuses, &iprod, title, &c_false, &itype,
lprod, &iop, &iblow);
L60:
if (_BLNK__1.land) {
goto L50;
}
L64:
if (! _BLNK__1.lright) {
goto L68;
}
L66:
incr_(&ic, &il);
if (! _BLNK__1.lequal) {
goto L66;
}
L68:
if (! (_BLNK__1.lor || _BLNK__1.lequal)) {
goto L74;
}
L70:
;
}
L74:
ill = il;
getsym_(lbuf, ibuf, &c__1, &ic, &il);
if (_BLNK__1.lleft || _BLNK__1.lequal) {
goto L28;
}
L100:
if (ill == ftest_1.ifunct || ill == ftest_1.idesc || ill == ftest_1.iend)
{
goto L102;
}
/* PRINT AN ERROR MESSAGE FOR AN UNRECOGNIZABLE SYMBOL */
ilerr = ill + 4;
io___74.ciunit = lunit_1.pms;
s_wsfe(&io___74);
do_fio(&c__1, (char *)&bel, (ftnlen)sizeof(integer));
e_wsfe();
io___75.ciunit = lunit_1.pms;
s_wsfe(&io___75);
for (i__ = 1; i__ <= 8; ++i__) {
do_fio(&c__1, (char *)&ibuf[i__ - 1], (ftnlen)sizeof(integer));
}
do_fio(&c__1, (char *)&ilerr, (ftnlen)sizeof(integer));
for (i__ = 1; i__ <= 80; ++i__) {
do_fio(&c__1, (char *)&pge_1.ipage[i__ + ill * 80 - 81], (ftnlen)
sizeof(integer));
}
e_wsfe();
/* PRINT AN ERROR MESSAGE FOR ACTIVE HIGH/LOW ERRORS */
if (lact && ! loperr) {
io___76.ciunit = lunit_1.pms;
s_wsfe(&io___76);
do_fio(&c__3, (char *)&ipal[0], (ftnlen)sizeof(integer));
do_fio(&c__5, (char *)&iname[0], (ftnlen)sizeof(integer));
e_wsfe();
}
/* PRINT AN ERROR MESSAGE FOR AN INVALID OUTPUT PIN */
if (loperr && imatch != 0) {
io___77.ciunit = lunit_1.pms;
s_wsfe(&io___77);
do_fio(&c__1, (char *)&imatch, (ftnlen)sizeof(integer));
do_fio(&c__3, (char *)&ipal[0], (ftnlen)sizeof(integer));
do_fio(&c__5, (char *)&iname[0], (ftnlen)sizeof(integer));
e_wsfe();
}
/* PRINT AN ERROR MESSAGE FOR AN INVALID INPUT PIN */
if (linp) {
io___78.ciunit = lunit_1.pms;
s_wsfe(&io___78);
do_fio(&c__1, (char *)&imatch, (ftnlen)sizeof(integer));
do_fio(&c__3, (char *)&ipal[0], (ftnlen)sizeof(integer));
do_fio(&c__5, (char *)&iname[0], (ftnlen)sizeof(integer));
e_wsfe();
}
sub_exit();
L102:
tweek_(&itype, lfuses_1.lfuses, lfuses_1.lphant);
L108:
s_wsfe(&io___79);
e_wsfe();
s_wsfe(&io___80);
e_wsfe();
s_wsfe(&io___81);
e_wsfe();
io___82.ciunit = roc;
s_rsfe(&io___82);
do_fio(&c__1, (char *)&iop, (ftnlen)sizeof(integer));
e_rsfe();
/* CALL IODC2 */
if (lunit_1.pof != 6) {
io___83.ciunit = lunit_1.pof;
s_wsfe(&io___83);
e_wsfe();
}
if (iop == e) {
echo_(ipal, iname, rest, patnum, title, comp);
}
if (iop == o) {
pinout_(ipal, iname, title);
}
if (iop == t) {
L__1 = iop != jj;
test_(lphase, lbuf, title, &ic, &il, &ile, isym, ibuf, &itype, &ipctr,
&lerr, &isaf, &ipctr1, &c_false, &c_false, &L__1);
}
if (iop != jj) {
goto L130;
}
L__1 = iop != jj;
test_(lphase, lbuf, title, &ic, &il, &ile, isym, ibuf, &itype, &ipctr, &
lerr, &isaf, &ipctr1, &c_false, &c_false, &c_false, &L__1);
plotf_(&itype, &iot);
L130:
isaf = 0;
if (iop == f) {
goto L200;
}
L135:
if (iop == p) {
plot_(lbuf, ibuf, lfuses_1.lfuses, &iprod, title, &c_true, &itype,
lprod, &iop, &iblow, &ipctr0);
}
if (iop == b) {
plot_(lbuf, ibuf, lfuses_1.lfuses, &iprod, title, &c_true, &itype,
lprod, &iop, &iblow, &ipctr0);
}
if (iop == h__) {
hex_(lfuses_1.lfuses, &h__);
}
if (iop == s) {
hex_(lfuses_1.lfuses, &s);
}
if (iop == l) {
binr_(lfuses_1.lfuses, &h__, &l);
}
if (iop == n) {
binr_(lfuses_1.lfuses, &p, &n);
}
if (iop == c__) {
cat_();
}
/* CALL IODC4 */
/* (INTEL PROGRAMMING FORMAT) */
if (iop == ii) {
intel_(lfuses_1.lfuses, &ii);
}
if (iop != q) {
goto L108;
}
sub_exit();
/* SETTING THE PARAMETERS FOR THE SA0/SA1 TESTS */
L200:
ipctr = 0;
L__1 = iop != jj;
test_(lphase, lbuf, title, &ic, &il, &ile, isym, ibuf, &itype, &ipctr, &
lerr, &isaf, &ipctr1, &c_false, &c_false, &L__1);
ipctr0 = ipctr;
/* LOOPING FOR SA1 TEST */
i__1 = ipctr0;
for (ipctr1 = 1; ipctr1 <= i__1; ++ipctr1) {
lsa11 = TRUE_;
L__1 = iop != jj;
test_(lphase, lbuf, title, &ic, &il, &ile, isym, ibuf, &itype, &ipctr,
&lerr, &isaf, &ipctr1, &lsa11, &c_false, &L__1);
/* L210: */
}
isa1 = isaf;
/* LOOPING FOR SA0 TEST */
i__1 = ipctr0;
for (ipctr1 = 1; ipctr1 <= i__1; ++ipctr1) {
lsa01 = TRUE_;
L__1 = iop != jj;
test_(lphase, lbuf, title, &ic, &il, &ile, isym, ibuf, &itype, &ipctr,
&lerr, &isaf, &ipctr1, &c_false, &lsa01, &L__1);
/* L215: */
}
isa0 = isaf - isa1;
ifault = isaf * 100 / (ipctr0 << 1);
io___94.ciunit = lunit_1.pof;
s_wsfe(&io___94);
do_fio(&c__1, (char *)&isa1, (ftnlen)sizeof(integer));
e_wsfe();
io___95.ciunit = lunit_1.pof;
s_wsfe(&io___95);
do_fio(&c__1, (char *)&isa0, (ftnlen)sizeof(integer));
e_wsfe();
io___96.ciunit = lunit_1.pof;
s_wsfe(&io___96);
do_fio(&c__1, (char *)&ifault, (ftnlen)sizeof(integer));
e_wsfe();
goto L135;
} /* MAIN__ */
#undef l
#undef s
#undef h__
#undef b