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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
|
PAGE ,132 ;
TITLE MODE COMMAND - COMMAND PARSING
.XLIST ;AN000;
INCLUDE STRUC.INC ;AN000;
.LIST ;AN000;
;.SALL ;AN000;
;��������������������������������� P R O L O G ����������������������������������������ͻ
;� �
; AC001 - P3259: When "/STATUS" was only parameter was returning "Invalid
; number of parameters". When "/STATUS" was first parameter
; the device name was not being recognized.
; AC002 - P3258, PS/2 only COM parameters were being allowed on non-PS/2
; P3540: machines. Added checks for baud=19200, parity=mark or space,
; data=5 or 6, stop=1.5 for both keyword and positional forms.
; AC003 - P3451: Wasn't treating semicolons as a valid blank-like delimeter.
; AC004 - P3456: /STAT wasn't included in all checks for valid forms of /STATUS.
; "BW" and "CO" were being accepted as valid parms.
; AC005 - P3796: PRN /STA returned "Invalid parameter -" when worked OK for
; LPT1.
; AC006 - P3932: Was issuing "Invalid parameter - ???" for switches that are
; not valid, now issue "Invalid switch - ???".
; AC007 - P3931: "CON SEL=850" acts like a status request, should return
; "Invalid number of parameters" because user forgot "CP".
; AX008 - P5183: Was denying 19200 baud on PS/2 model 30s and 25s and VAILs.
;� �
;��������������������������������� P R O L O G ����������������������������������������ͼ
;��������������������������������� M A C R O S ����������������������������������������ͻ
;� �
BREAK MACRO X ;AN000;
JMP endcase_&X ;AN000;
ENDM ;AN000;
;-------------------------------------------------------------------------------
DISPLAY MACRO MESSAGE ;AN000;
MOV DX,MESSAGE ;AN000;
CALL PRINTF ;AN000;
ENDM
;-------------------------------------------------------------------------------
check_for_lpt_keyword MACRO ;AN000;
MOV DL,number_of_lpt_keywords ;;AN000;Initialize
MOV number_of_keywords,DL ;;AN000; for call to check_for_keyword
MOV BP,OFFSET start_lpt_keyword_ptrs ;;AN000;start_of_keyword_ptrs=[BP]
CALL check_for_keyword ;AN000;
ENDM ;AN000;
;�������������������������������������������������������������������������������
;�
;� DELETE_PARSER_VALUE_LIST_ENTRY
;� -------------------------------
;�
;� As the logic in PARSE_PARAMETERS proceeds the posibilities for the next parm
;� become apparent and the parser control blocks need to be changed to correctly
;� parse the next parm. This MACRO is the interface to the approptiate routine which
;� modifies the list of strings or keywords in the VALUES block.
;�
;�
;�
;�
;�
;� INPUT: item_type - scalar indicating that a string or keyword is to be deleted
;�
;� item - A scalar immediate that indicates the string or keyword to
;� be "deleted"
;�
;�
;� RETURN: none
;�
;�
;� MESSAGES: none
;�
;�
;�
;�
;� REGISTER
;� USAGE: "item" is put into BX.
;�
;�
;�
;� CONVENTIONS:
;�
;�
;�
;� ASSUMPTIONS: All the input are valid.
;�
;�
;�
;�
;�
;�
;�
;�
;�
;�
;� SIDE EFFECT:
;�
;�
;�������������������������������������������������������������������������������
delete_parser_value_list_entry MACRO item_type,item ;AN000;
;MOV BX,item ;AN000;
CALL item_type ;AN000;
ENDM ;AN000;
;-------------------------------------------------------------------------------
;�������������������������������������������������������������������������������
;�
;� MODIFY_PARSER_CONTROL_BLOCK
;� ---------------------------
;�
;� As the logic in PARSE_PARAMETERS proceeds the posibilities for the next parm
;� become apparent and the parser control blocks need to be changed to correctly
;� parse the next parm. This MACRO is the interface to the routines that modify
;� those control blocks.
;�
;�
;�
;�
;�
;� INPUT: control_structure - A scalar immediate indicating the control block
;� to be modified, and the routine to call.
;�
;� action - A scalar immediate that indicates the nature
;� of the modification to be made.
;�
;� item - A scalar immediate that indicates the string, number,
;� keywords, switch, or match flags mask involved.
;�
;� RETURN: none
;�
;�
;� MESSAGES: none
;�
;�
;�
;�
;� REGISTER
;� USAGE: The scalar value for the modifier will be put in a register
;� for passing to the routine that actually does the work.
;�
;�
;� CONVENTIONS:
;�
;�
;�
;� ASSUMPTIONS: All the input are valid.
;�
;�
;� SIDE EFFECT:
;�
;�
;�������������������������������������������������������������������������������
modify_parser_control_block MACRO control_structure,action,item ;AN000;
PUSH BX ;AN000;
MOV BX,action ;AN000;
MOV AL,item ;AN000;
CALL control_structure ;AN000;
POP BX ;AN000;
ENDM ;AN000;
;-------------------------------------------------------------------------------
;� �
;��������������������������������� M A C R O S ����������������������������������������ͼ
;�������������������������������� E Q U A T E S ���������������������������������������ͻ
;� �
INCLUDE modequat.inc
addd EQU 0 ;;AN000;used for "seperator_list"
binary_to_ASCII EQU 30H ;AN000;used to convert bytes from binary to ASCII
blank EQU " ";;AN000;used for "seperator_list"
both EQU 2 ;AN000;value of rate_and_delay_found when both have been found
comma EQU "," ;AN000;used to tell the difference between a blank delimeter and missing parm, see LPTX,:
current_parm EQU 0 ;;AN000;scalar for parser control block modifing routine "keywords"
current_parm_DI EQU DI ;;AN000;index for parm_list array
delete EQU 1 ;AN000;;used for "seperator_list"
deleted EQU 0 ;AN000;;used to make keywords unmatchable and strings of length zero
end_of_line_char_0D EQU 0DH ;AN000;put at end of the command line by the loader
end_of_line_char_00 EQU 00H ;AN000;put at end of the complex parm by the parser
i_CL EQU CL ;;AN000;loop index
include_string_list EQU 3 ;;AN000;number of value definitions so strings are included
include_number_list EQU 2 ;;AN000;See "nrng" in description of "values" block input for generalized parser
keyword EQU 58H ;;AN000;indicator parms are in keyword form vs positional, value for parms_form
first_com_keyword EQU SI ;;AN000;holder for "first_com_keyword_ptr"
last_com_keyword EQU SI ;;AN000;holder for "last_com_keyword_ptr"
first_LPT_keyword EQU SI ;;AN000;holder for "first_LPT_keyword_ptr"
last_LPT_keyword EQU SI ;;AN000;holder for "last_LPT_keyword_ptr"
first_CON_keyword EQU SI ;;AN000;holder for "first_con_keyword_ptr"
last_CON_keyword EQU SI ;;AN000;holder for "last_con_keyword_ptr"
max_parms EQU 16 ;;AN000;con cp prep=((1,2,3,4,5,6,7,8,9,10,11,12) filespec.cpi)
min_codepage_value EQU 0 ;AN000;
max_codepage_value EQU 999 ;;AN000;three digits
max_number_of_codepages EQU 12 ;AN000;assure that user does not specify too many code page numbers
min_number_of_codepages EQU 1 ;AN000;
min_old_com_pos_parms EQU 0 ;AN000;could have nothing else meaning status request
max_old_com_pos_parms EQU 5 ;AN000; ;baud, parity, data bits, stop bits, P
max_switches EQU 1 ;AN000;;only switch is /status
no_message EQU 0 ;AN000;indicate to message handler interface that no message to issue
none_found EQU 0 ;AN000;;if keyword_switch_ptr is returned as zero then parser did not encounter a keyword or switch
not_in_switch_list EQU 3 ;AC006;
number_of_printer_status_qualifiers EQU 4 ;;AN000;codepage, prepare, select, RETRY
parm_list EQU [BX] ;AN000;
parms_BX EQU [BX] ;AN000;
parser_return_code_AX EQU AX ;AN000;
PS2 EQU 44H ;AC002;flag for "type_of_machine"
result_BP EQU [BP] ;AN000;
range_item_tag EQU 55H ;AN000;;marker for checks in memory, otherwise just a holder
ranges_only EQU 1 ;;AN000;See "nrng" in description of "values" block input for generalized parser
start_of_keyword_ptrs EQU [BP] ;AN000;;used for indexing the list of offsets in check_for_keyword
tab EQU 09 ;AC006;
unspecified EQU 0FFH ;AN000;item tag of parm not specified: skipped optional positional parm
;possible values for "parm_type", the type of parm returned by parser
complx EQU 4 ;AN000;
number EQU 1 ;AN000;
string EQU 3 ;AN000;
;possible values for "return_code_AX"
no_error EQU 0 ;AN000;;not the same as "noerror"
operand_missing EQU 2 ;AN000;
syntax_error_rc EQU 9 ;AN000;
end_of_command_line EQU -1 ;AN000;
end_of_complex EQU -1 ;AN000;found 0 that parser wrote over closing ")" of complex
;possible values of "device_type"
COMX EQU 09CH ;AN000;
;CON EQU 0 ;AN000;
LPTX EQU 09BH ;AN000;
;LPT1 EQU 0 ;AN000;
;possible values of "request_type"
max_request_type EQU 09AH ;AN000;;must be same as following value
all_con_status EQU 09AH ;AN000;
codepage_prepare EQU 099H ;AN000;
codepage_refresh EQU 098H ;AN000;
codepage_select EQU 097H ;AN000;
codepage_status EQU 096H ;AN000;
codepage_prepared_status EQU 095H ;AN000;
codepage_selected_status EQU 094H ;AN000;
com_status EQU 093H ;AN000;
initialize_com_port EQU 092H ;AN000;
initialize_printer_port EQU 091H ;AN000;
old_initialize_printer_port EQU 090H ;AN000;;found traditional syntax
old_video_mode_set EQU 08FH ;AN000;;found traditional syntax
printer_reroute EQU 08EH ;AN000;
printer_status EQU 08DH ;AN000;
set_con_features EQU 08CH ;AN000;
status_for_everything EQU 08BH ;AN000;
turn_off_reroute EQU 08AH ;AN000;
last_request_type EQU 08AH ;AN000;;must be same as previous value
;possible codepage requests, used by modecp
select EQU 086H ;AN000;
prepare EQU 085H ;AN000;
refresh EQU 084H ;AN000;
;status ;AN000;;see request_type possibilities
;possible values of "looking_for"
codepage EQU 6FH ;AN000;
codepage_prms EQU 6EH ;AN000;
com_keyword EQU 6DH ;AN000;
com_keyword_or_baud EQU 6CH ;AN000;
CON_keyword EQU 6BH ;AN000;
con_kwrd_status_or_cp EQU 6AH ;AN000;
databits_or_null EQU 69H ;AN000;
device_name_or_eol EQU 68H ;AN000;
eol EQU 67H ;;AN000;end of line
first_parm EQU 66H ;AN000;
li_or_null EQU 65H ;AN000;
P EQU 64H ;AN000;
parity_or_null EQU 63H ;AN000;
prn_kw_status_cp_cl_null EQU 62H ;AN000;
sd_or_dl EQU 61H ;AN000;
sd_or_dl_or_eol EQU 60H ;AN000;
status_or_eol EQU 5FH ;AN000;
stopbits_or_null EQU 5EH ;AN000;
T_or_EOL EQU 5DH ;AN000;
max_looking_for EQU 6FH ;AN000;;used for calculating the displacement into jump table for "CASE looking_for="
;item tags for COM port names strings
COM1_item_tag EQU 1 ;;AN000;these values must be 1 through 4 because
COM2_item_tag EQU 2 ;;AN000;parsing for COM special cases depends
COM3_item_tag EQU 3 ;;AN000;on it.
COM4_item_tag EQU 4
;item tags for paritys
first_parity_item_tag EQU 86H ;AN000;
mark_item_tag EQU 86H ;AN000;
space_item_tag EQU 85H ;AN000;
none_item_tag EQU 84H ;AN000;
odd_item_tag EQU 83H ;AN000;
even_item_tag EQU 82H ;AN000;
last_parity_item_tag EQU 82H ;AN000;
;item tags for printer port names
PRN_item_tag EQU 5 ;AN000;
LPT1_item_tag EQU 6 ;AN000;
LPT2_item_tag EQU 7 ;AN000;
LPT3_item_tag EQU 8 ;AN000;
;item tags for screen modes
first_screen_mode_item_tag EQU 9 ;AN000;
BW40_item_tag EQU 0BH ;AN000;
BW80_item_tag EQU 0CH ;AN000;
CO40_item_tag EQU 0DH ;AN000;
CO80_item_tag EQU 0EH ;AN000;
eighty_item_tag EQU 0FH ;AN000;
fourty_item_tag EQU 10H ;AN000;
MONO_item_tag EQU 11H ;AN000;
last_screen_mode_item_tag EQU 11H ;AN000;
con_item_tag EQU 12H ;AN000;
;item tags for LPT special cases
first_lpt_special_case_item_tag EQU 13H ;;AN000;following value must be the same as this one
LPT1132_item_tag EQU 13H ;AN000;
LPT2132_item_tag EQU 14H ;AN000;
LPT3132_item_tag EQU 15H ;AN000;
LPT180_item_tag EQU 16H ;AN000;
LPT280_item_tag EQU 17H ;AN000;
LPT380_item_tag EQU 18H ;AN000;
last_lpt_special_case_item_tag EQU 18H ;;AN000;this value must be the same as the previous
P_item_tag EQU 19H ;AN000;
RETRY_item_tag EQU 1AH ;AN000;
B_item_tag EQU 1BH ;AN000;
E_item_tag EQU 1CH ;AN000;
R_item_tag EQU 1DH ;AN000;
codepage_item_tag EQU 1EH ;;AN000;for the range defining codepage possibilities
PREPARE_item_tag EQU 1FH ;AN000;
SELECT_item_tag EQU 20H ;AN000;
REFRESH_item_tag EQU 21H ;AN000;
COLUMNS_item_tag EQU 23H ;AN000;
DELAY_item_tag EQU 24H ;AN000;
LINES_item_tag EQU 25H ;AN000;
RATE_item_tag EQU 26H ;AN000;
COM_item_tag EQU 27H ;AN000;
ON_item_tag EQU 28H ;AN000;
OFF_item_tag EQU 29H ;AN000;
L_item_tag EQU 2AH ;AN000;
T_item_tag EQU 2BH ;AN000;
;item tags for numbers not in other lists
zero_item_tag EQU 2CH ;AN000;
first_stopbit_item_tag EQU 2DH ;AN000;
one_item_tag EQU 2EH ;AN000;
one_point_five_item_tag EQU 2FH ;AN000;
two_item_tag EQU 30H ;AN000;
last_stopbit_item_tag EQU 31H ;AN000;
three_item_tag EQU 32H ;AN000;
four_item_tag EQU 33H ;AN000;
first_databit_item_tag EQU 34H ;AN000;
five_item_tag EQU 35H ;AN000; ;data bit, typamatic rate
six_item_tag EQU 36H ;AN000;
seven_item_tag EQU 37H ;AN000;
eight_item_tag EQU 38H ;AN000;
last_databit_item_tag EQU 39H ;AN000;
nine_item_tag EQU 3AH ;AN000;
ten_item_tag EQU 3BH ;AN000;
eleven_item_tag EQU 3CH ;AN000;;first two chars of 110
twelve_item_tag EQU 3DH ;AN000;
thirteen_item_tag EQU 3EH ;AN000;
fourteen_item_tag EQU 3FH ;AN000;
fifteen_item_tag EQU 40H ;AN000;;abbreviated form of 150, 15 is also a RATE= candidate
sixteen_item_tag EQU 41H ;AN000;
seventeen_item_tag EQU 42H ;AN000;
eighteen_item_tag EQU 43H ;AN000;
nineteen_item_tag EQU 44H ;AN000;;used for baud rates and RATE=
twenty_item_tag EQU 45H ;AN000;
twentyone_item_tag EQU 46H ;AN000;
twentytwo_item_tag EQU 47H ;AN000;
twentythree_item_tag EQU 48H ;AN000;
twentyfour_item_tag EQU 49H ;AN000; ;24 is also a typamatic rate
twentyfive_item_tag EQU 4AH ;AN000;
twentysix_item_tag EQU 4BH ;AN000;
twentyseven_item_tag EQU 4CH ;AN000;
twentyeight_item_tag EQU 4DH ;AN000;
twentynine_item_tag EQU 4EH ;AN000;
thirty_item_tag EQU 4FH ;AN000;
thirtyone_item_tag EQU 50H ;AN000;
thirtytwo_item_tag EQU 51H ;AN000;
fourtythree_item_tag EQU 52H ;AN000;
fifty_item_tag EQU 53H ;AN000;
sixty_item_tag EQU 54H ;AN000;
oneten_item_tag EQU 55H ;AN000;
onethirtytwo_item_tag EQU 56H ;AN000;
onefifty_item_tag EQU 57H ;AN000;
threehundred_item_tag EQU 58H ;AN000;
sixhundred_item_tag EQU 59H ;AN000;
twelvehundred_item_tag EQU 5AH ;AN000;
twentyfourhundred_item_tag EQU 5BH ;AN000;
fourtyeighthundred_item_tag EQU 5CH ;AN000;
ninetysixhundred_item_tag EQU 5DH ;AN000;
nineteentwohundred_item_tag EQU 5EH ;AN000;
;mask values for function_flags
capitalize EQU 0001H ;AN000;capitalize by file table
;mask values for match flags
numeric EQU 8000H ;AN000;
simple_string EQU 2000H ;AN000;
complex EQU 0400H ;AN000;
filespec EQU 0200H ;AN000;
ignore_colon EQU 0010H ;AN000;
optional EQU 0001H ;AN000;
clear_all EQU 0000H ;AN000;
;delete_simple_string EQU 0CFFFH ;AN000;;NOT (simple_string), to turn off simple_string bit in the match_flags
;� �
;�������������������������������� E Q U A T E S ���������������������������������������ͼ
;������������������������������ S T R U C T U R E S �����������������������������������ͻ
;� �
des_strt_packet STRUC
des_strt_pkfl DW 0000 ;assume a filename specified
des_strt_pklen DW 02 ;start with size of 'des_strt_pknum'
des_strt_pknum DW 0 ;number of cp numbers in the packet
des_strt_pkcp1 DW -1 ;code page number for 1st slot
des_strt_pkcp2 DW -1
des_strt_pkcp3 DW -1
des_strt_pkcp4 DW -1
des_strt_pkcp5 DW -1
des_strt_pkcp6 DW -1
des_strt_pkcp7 DW -1
des_strt_pkcp8 DW -1
des_strt_pkcp9 DW -1
des_strt_pkcpA DW -1
des_strt_pkcpB DW -1
des_strt_pkcpC DW -1 ;code page number for 12th slot
des_strt_packet ENDS
INCLUDE COMMON.STC ;contains the following strucs, needed in invoke also
;parm_list_entry STRUC
;
;parm_type DB bogus
;item_tag DB 0FFH
;value1 DW bogus
;value2 DW bogus
;keyword_switch_ptr DW 0
;
;parm_list_entry ENDS
;codepage_parms STRUC
; cp_device DW ?
; des_pack_ptr DW ?
; font_filespec DW ?
; request_typ DW ?
;codepage_parms ENDS
parms_def STRUC ;AN000;
parmsx_ptr DW bogus ;AN000;changed as the possibilities for parms following are determined
DB 1 ;AN000;have extra delimiter list
seperators_len DB 1 ;AN000;length of extra delimiter list
seperators DB ";" ;AC003;EXTRA DELIMITER LIST
DB 8 DUP (" ") ;AC003; extra blanks for adding more delimeters (. " \ [ ] : + =)
parms_def ENDS ;AN000;
result_def STRUC ;AN000;
ret_type DB 0 ;AN000;
ret_tag DB 0FFH ;AN000;
synonym DW 0 ;AN000;
ret_value1 DW bogus ;AN000;
ret_value2 DW bogus ;AN000;
result_def ENDS ;AN000;
;� �
;������������������������������ S T R U C T U R E S �����������������������������������ͼ
PAGE ;AN000;
PRINTF_CODE SEGMENT PUBLIC ;AN000;
ASSUME CS:PRINTF_CODE,DS:PRINTF_CODE,SS:PRINTF_CODE ;AN000;
;�������������������������������� P U B L I C S ���������������������������������������ͻ
;� �
PUBLIC all_con_status ;AN000;
PUBLIC baud_equal ;AN000;
PUBLIC B_item_tag ;needed by modecom ;AN000;
PUBLIC B_str ;AN000;
PUBLIC BW40_item_tag ;AN000;
PUBLIC BW80_item_tag ;AN000;
PUBLIC codepage_index_holder ;make available to invoke ;AN000;
PUBLIC codepage_item_tag ;AN000;
PUBLIC codepage_prepare ;AN000;
PUBLIC codepage_prepared_status ;AN000;
PUBLIC codepage_refresh ;AN000;
PUBLIC codepage_selected_status ;AN000;
PUBLIC COM_status ;AN000;
PUBLIC COMX ;make available to rescode ;AN000;
PUBLIC CON_str ;AN000;make available to invoke for messages
PUBLIC CO40_item_tag ;AN000;
PUBLIC CO80_item_tag ;AN000;
PUBLIC codepage_item_tag ;AN000;
PUBLIC codepage_select ;AN000;
PUBLIC codepage_status ;AN000;
PUBLIC columns_equal ;AN000;
PUBLIC COLS_equal ;AN000;
PUBLIC columns_item_tag ;AN000;
PUBLIC COM1_str ;AN000;
PUBLIC COM2_str ;AN000;
PUBLIC COM3_str ;AN000;
PUBLIC COM4_str ;AN000;
PUBLIC data_equal ;AN000;used by invoke
PUBLIC delay_equal ;AN000;
PUBLIC del_equal ;AN000;
PUBLIC des_start_packet ;AN000;
PUBLIC device_name ;AN000;
PUBLIC device_type ;AN000;make available to rescode
PUBLIC E_item_tag ;needed by modecom ;AN000;
PUBLIC E_str ;AN000;
PUBLIC eight_item_tag ;AN000;used by setcom
PUBLIC eighty_item_tag ;AN000;
PUBLIC eighty_str ;AN000;
PUBLIC even_item_tag ;AN000;used by setcom
PUBLIC five_item_tag ;AN000;used in setcom
PUBLIC fourtyeighthundred_item_tag ;used by setcom;AN000;
PUBLIC fourtyeighthundred_str ;used by setcom;AN000;
PUBLIC fourty_item_tag ;AN000;
PUBLIC fourty_str ;AN000;
PUBLIC initialize_com_port ;AN000;
PUBLIC initialize_printer_port ;AN000;
PUBLIC keyword ;AN000;make available to invoke.asm
PUBLIC len_COMX_str ;AN000;make available to invoke.asm
PUBLIC len_CON_str ;AN000;make available to invoke.asm for message service
PUBLIC len_LPTX_str ;AN000;make available to invoke.asm
PUBLIC lines_equal ;AN000;
PUBLIC lines_item_tag ;AN000;
PUBLIC L_item_tag ;AN000;
PUBLIC LPTX ;AN000;make available to rescode
PUBLIC LPT1_str ;AN000;
PUBLIC LPT2_str ;AN000;
PUBLIC LPT3_str ;AN000;
PUBLIC mark_item_tag ;AN000;used in setcom
PUBLIC max_request_type ;AN000;
PUBLIC mono_item_tag ;AN000;
PUBLIC new_com_initialize ;AC002;make available for modecom
PUBLIC nineteentwohundred_item_tag ;AN000;used by modecom
PUBLIC nineteentwohundred_str ;AN000;used by modecom
PUBLIC ninetysixhundred_item_tag ;AN000;
PUBLIC ninetysixhundred_str ;AN000;
PUBLIC none_item_tag ;AN000;used in invoke
PUBLIC NONE_str ;AN000;
PUBLIC OFF_item_tag ;AN000;
PUBLIC OFF_str ;AN000;
PUBLIC odd_item_tag ;AN000; ;used by setcom
PUBLIC old_initialize_printer_port ;AN000;
PUBLIC old_video_mode_set ;AN000;
PUBLIC one_item_tag ;used in setcom ;AN000;
PUBLIC one_point_five_item_tag ;used in setcom ;AN000;
PUBLIC one_point_five_str ;used in setcom ;AN000;
PUBLIC onefifty_item_tag ;used in setcom ;AN000;
PUBLIC onefifty_str ;used in setcom ;AN000;
PUBLIC oneten_item_tag ;used in modecom ;AN000;
PUBLIC oneten_str ;used in modecom ;AN000;
PUBLIC onethirtytwo_item_tag ;AN000;
PUBLIC ON_item_tag ;AN000;
PUBLIC ON_str ;AN000;
PUBLIC P_item_tag ;make available to modecom ;AN000;
PUBLIC parity_equal ;used in analyze_and_invoke ;AN000;
PUBLIC parm_lst ;used in modecom.asm ;AN000;
PUBLIC parms_form ;make available to invoke ;AN000;
PUBLIC parse_parameters ;AN000;
PUBLIC prepare ;AN000;
PUBLIC prepare_item_tag ;AN000;
PUBLIC printer_reroute ;AN000;
PUBLIC printer_status ;AN000;
PUBLIC R_item_tag ;AN000;
PUBLIC R_str ;AN000;
PUBLIC rate_equal ;AN000;
PUBLIC refresh ;AN000;
PUBLIC request_type ;AN000;
PUBLIC reroute_requested ;make available to rescode;AN000;
PUBLIC retry_equal_str ;make available to invoke;AN000;
PUBLIC retry_item_tag ;AN000;
PUBLIC retry_requested ;make available to rescode ;AN000;
PUBLIC select ;AN000;
PUBLIC select_item_tag ;AN000;
PUBLIC set_con_features ;AN000;
PUBLIC seven_item_tag ;used by setcom ;AN000;
PUBLIC sixhundred_item_tag ;used by setcom ;AN000;
PUBLIC sixhundred_str ;used by setcom ;AN000;
PUBLIC six_item_tag ;used by setcom ;AN000;
PUBLIC space_item_tag ;used by setcom ;AN000;
PUBLIC status_for_everything ;AN000;
PUBLIC stop_equal ;AN000;
PUBLIC T_item_tag ;AN000;
PUBLIC threehundred_item_tag ;used by setcom ;AN000;
PUBLIC threehundred_str ;used by setcom ;AN000;
PUBLIC turn_off_reroute ;AN000;
PUBLIC twelvehundred_item_tag ;used by setcom ;AN000;
PUBLIC twelvehundred_str ;used by setcom ;AN000;
PUBLIC twentyfourhundred_item_tag ;used by setcom ;AN000;
PUBLIC twentyfourhundred_str ;used by setcom ;AN000;
PUBLIC two_item_tag ;used by setcom ;AN000;
;� �
;�������������������������������� P U B L I C S ���������������������������������������ͼ
;�������������������������������� E X T R N S �����������������������������������������ͻ
;� �
;EXTRN command_line:BYTE ;AN000;PARM AREA
;EXTRN command_line_length:BYTE ;AN000;NUMBER OF BYTES OF PARM AREA
EXTRN com1_or_com2:BYTE ;AN000;see modedefs.inc
EXTRN cp_cb:WORD ;AN000;codepage_parms <> ;codepage subroutine parameter block
EXTRN CRLF:WORD ;displayed before "Invalid parameter - " for consistent spacing ;AN000;
EXTRN DES_STRT_FL_CART:ABS ;AN000;;CARTRIDGE prepare
EXTRN device:BYTE ;AN000;holder for com number, used in setcom
EXTRN first_char_in_command_line:BYTE ;AN000;location of the command line parameters
EXTRN function_not_supported:BYTE ;AN000;see modedefs.inc
EXTRN get_machine_type:NEAR ;AN000;get model and sub-model bytes
EXTRN invalid_parameter:BYTE ;AN000;CR,LF,"Invalid parameter - '????'"CR,LF,BEEP
EXTRN LPTNO:BYTE ;AN000;holder of ASCII version of printer number, see first_parm_case and modeprin
EXTRN machine_type:BYTE ;AN000;see get_machine_type
EXTRN modecp:NEAR ;AN000;
EXTRN move_destination:ABS ;AN000;location of res code after it has been moved
EXTRN noerror:BYTE ;AN000;
EXTRN not_supported_ptr:WORD ;AN000;holder of address of string that describes what is not supported, see modedefs.inc
EXTRN offending_parameter:BYTE ;AC006;the holder of the text string that was wrong.
EXTRN offending_parameter_ptr:WORD ;AN000;;see MODEMES
EXTRN printer_no:BYTE ;AN000;;see modeprin
EXTRN PRINTF:NEAR ;AN000;
EXTRN rate_and_delay_together:BYTE ;AN000;RATE and DELAY must be specified together
EXTRN syntax_error_ptr:WORD ;AN000;pointer to parameter with bad format
;possible values of "message"
EXTRN baud_rate_required:BYTE ;AN000;
EXTRN invalid_number_of_parameters:WORD ;AN000;
EXTRN Invalid_switch:BYTE
EXTRN syntax_error:BYTE
;� �
;�������������������������������� E X T R N S �����������������������������������������ͼ
;������������������������������������ D A T A �����������������������������������������ͻ
;� �
code_page_numbers_encountered DB 0
current_packet_cp_number DW -2 ;adjustment for accessing current 'des_strt_pkcp?' in 'des_start_packet'
EOL_found DB false
looking_for DB bogus ;semantic analysis state, can be one of:
match_not_found DB true ;indication that a token was found in the list of keywords
des_start_packet des_strt_packet <>
;---------------------------- NEW DATA ---------------------------------
baud_specified DB false ;AN000;
codepage_index_holder DW bogus ;AN000;;holder for index in parm_list of the selected code page
colon DB ":" ;AN000;
command_line DW 0081H ;AN000; ;holder for pointer to unparsed part of the command line, see "parse_parm"
device_name DW 0 ;AN000;;OFFSET device name string, see "analyze_and_invoke" in invoke.asm
device_type DB bogus ;AN000;
end_of_seperator_list DW bogus ;AN000;;loop terminator,word because compared with DI
match_found DB false ;AN000; ;boolean loop terminator
message DW no_message ;AN000;
new_com_initialize DB false ;AC002;flag for modecom to indicate PS/2 only parm specified
number_of_keywords DB 0 ;AN000;;input for check_for_keyword
parms_form DB 0 ;AN000;;holder for indicator of whether the parms were in keyword or positonal form
ordinal DW 0 ;AN000;
rate_and_delay_found DB false ;AN000;need to have both, this byte keeps track of what has been found
request_type DB bogus ;AN000;
reroute_requested DB false ;AN000;
retry_requested DB false ;AN000;
search_stop DB 0 ;AN000;;loop stopper for search_item_tags
status_found DB false ;AN000;;boolean indicator that /status has been found
status_request DB bogus ;AN000;;furthur clarification. possible values are: bogus, true, and false
terminating_delimeter DB bogus ;AN000;;save return from sysparse
type_of_machine DB bogus ;AC000;"get_machine_type" determines "machine_type", this byte is general flag for PS/2s
; PARSER interface data
;---------------------------------------
start_com_keyword_ptrs LABEL WORD ;AN000;
first_com_keyword_ptr DW OFFSET baud_equal ;AN000;
DW OFFSET parity_equal ;AN000;
DW OFFSET data_equal ;AN000;
DW OFFSET stop_equal ;AN000;
last_com_keyword_ptr DW OFFSET retry_equal_str ;AN000;
number_of_com_keywords EQU ($ - start_com_keyword_ptrs)/2 ;AN000;
start_LPT_keyword_ptrs LABEL WORD ;AN000;
first_LPT_keyword_ptr DW OFFSET retry_equal_str ;AN000;
DW OFFSET COLUMNS_equal ;AN000;
DW OFFSET COLS_equal ;AN000;
last_LPT_keyword_ptr DW OFFSET LINES_equal ;AN000;
number_of_LPT_keywords EQU ($ - start_LPT_keyword_ptrs)/2 ;AN000;
start_CON_keyword_ptrs LABEL WORD ;AN000;
first_CON_keyword_ptr DW OFFSET COLUMNS_equal ;AN000;
DW OFFSET COLS_equal ;AN000;
DW OFFSET LINES_equal ;AN000;
DW OFFSET RATE_equal ;AN000;
DW OFFSET DELAY_equal ;AN000;
last_CON_keyword_ptr DW OFFSET DEL_equal ;AN000;
number_of_CON_keywords EQU ($ - start_CON_keyword_ptrs)/2 ;AN000;
parms parms_def<> ;AN000;set up for first_parm_case, except parmsx_ptr needs to be set
parmsx LABEL BYTE ;AN000;
DB 0 ;AN000;how many non-switch/non-keyword parms are required
DB 3 ;AN000;max pos parms for this parmsx, use others for further parms
DW first_pos_control ;AN000;control block for every possible (non-mutatant) first positional parm
DW second_pos_control ;AN000;
DW third_pos_control ;AN000;
DB max_switches ;AN000;
DW max_switches DUP (Sw_control) ;AN000;
DB max_keywords ;AN000;number of unique keywords for all options
start_keyword_list LABEL BYTE ;AN000;
DW LPT1_colon_equal_control ;AN000;
DW LPT1_equal_control ;AN000;
DW LPT2_colon_equal_control ;AN000;
DW LPT2_equal_control ;AN000;
DW LPT3_colon_equal_control ;AN000;
DW LPT3_equal_control ;AN000;
DW RETRY_equal_control ;AN000;for parallel and serial printers
DW COLUMNS_equal_control ;AN000;
DW LINES_equal_control ;AN000;;this and previous MUST OCCUR IN THIS ORDER
DW PREPARE_equal_control ;AN000;
DW SELECT_equal_control ;AN000;
max_keywords EQU ($ - start_keyword_list) / 2 ;AN000;two bytes per entry
con_parmsx LABEL BYTE ;AN000;for keyword form of con support
DB 0 ;AN000;no positional parms required after CON
DB 2 ;AN000;CP and REFRESH allowed
DW first_CON_pos_control ;AN000;control block for CP
DW second_CON_pos_control ;AN000;control block for REFRESH
DB max_switches ;AN000;
DW max_switches DUP (Sw_control) ;AN000;
DB number_of_CON_keywords ;AN000;number of unique keywords for CON
start_con_keyword_list LABEL BYTE ;AN000;
DW COLUMNS_equal_control ;AN000;
DW LINES_equal_control ;AN000;
DW PREPARE_equal_control ;AN000;
DW SELECT_equal_control ;AN000;
DW DELAY_equal_control ;AN000;
DW RATE_equal_control ;AN000;
number_of_con_keywords EQU ($ - start_con_keyword_list) / 2 ;AN000;two bytes per entry
old_con_parmsx LABEL BYTE ;AN000;
DB 0 ;AN000;no positional parms required after 80, co40 etc.
DB 2 ;AN000;shift direction and "T" allowed
DW first_old_CON_pos_control ;AN000;shift direction and display lines
DW second_old_CON_pos_control ;AN000;control block for T
DB 0 ;AN000;no switches
DB 0 ;AN000;no keywords for old CON
lpt_parmsx LABEL BYTE ;AN664;for the second thru 4th parms, [[chars/line][[,lines/inch][[,P]]]]
DB 0 ;AN000;how many non-switch/non-keyword parms are required
DB 3 ;AN000;max pos parms for this parmsx, use others for further parms
DW first_lpt_pos_control ;AN000;control block for every possible chars per line value
DW second_lpt_pos_control ;AN000;
DW third_lpt_pos_control ;AN000;
DB max_switches ;AN000;
DW max_switches DUP (Sw_control) ;AN000;
DB max_lpt_keywords ;AN000;number of unique keywords for all options
start_lpt_keyword_list LABEL BYTE ;AN000;
DW RETRY_equal_control ;AN000;for parallel printers
DW COLUMNS_equal_control ;AN000;
DW LINES_equal_control ;AN000;;this and previous MUST OCCUR IN THIS ORDER
DW PREPARE_equal_control ;AN000;
DW SELECT_equal_control ;AN000;
max_lpt_keywords EQU ($ - start_keyword_list) / 2 ;AN000;two bytes per entry
prepare_equal_parmsx LABEL BYTE ;AN000;
prepare_min_parms LABEL BYTE ;AN000;changed by hardware cp code to allow no filename
DB min_number_of_codepages ;AN000;
DB max_number_of_codepages ;AN000;
DW max_number_of_codepages DUP (prepare_equal_control) ;AN000;
DB max_switches ;AN000;
DW max_switches DUP (Sw_control) ;AN000;
DB 0 ;AN000;no more keywords allowed
com_parmsx LABEL BYTE ;AN000;
DB min_old_com_pos_parms ;AN000;nothing or /STATUS
DB max_old_com_pos_parms ;AN000;baud, parity, data, stop, p
DW baud_control ;AN000;
DW old_com_parity_control ;AN000;
DW old_com_databits_control ;AN000;control block for old com data bits
DW old_com_stopbits_control ;AN000;
retry_control_ptr DW old_com_retry_control ;AN000;
DB max_switches ;AN000;
DW max_switches DUP (Sw_control) ;AN000;
DB number_of_com_keywords ;AN000;
start_com_keyword_list LABEL BYTE ;AN000;
DW BAUD_control ;AN000;
DW PARITY_equal_control ;AN000;
DW DATA_equal_control ;AN000;
DW STOP_equal_control ;AN000;
DW RETRY_equal_control ;AN000;same as for printers
number_of_com_keywords EQU ($ - start_com_keyword_list) / 2 ;AN000;two bytes per entry
com_keywords_parmsx LABEL BYTE ;AC663;
DB 0 ;AC663;no positional parms valid
DB 0 ;AC663;
DB 0 ;AC663;
DB number_of_com_keywords ;AC663;
DW BAUD_control ;AC663;
DW PARITY_equal_control ;AC663;
DW DATA_equal_control ;AC663;
DW STOP_equal_control ;AC663;
DW RETRY_equal_control ;AC663;same as for printers
mutant_com_parmsx LABEL BYTE ;AN000;for trash like COM19600
DB 2 ;AN000;;must find "COM" and a baud rate
DB 2 ;AN000;;"COM", baud
DW COM_control ;AN000;
DW baud_control ;AN000;use same as other com parmsx
DB 0 ;AN000;no switches
DB 0 ;AN000;no keywords
com_control LABEL BYTE ;AN000;for mutant_com_parmsx
DW simple_string ;AN000;"COM", not optional
DW 0 ;AN000;don't capitalize, leave colon
DW result ;AN000;
DW com_value ;AN000;
DB 0 ;AN000;no synonyms
old_com_parity_control LABEL BYTE ;AC000;
DW simple_string+optional ;AC000;n, o, e are strings
DW 0 ;AC000;don't capitalize, leave colon
DW result ;AC000;
DW PARITY_values ;AC000;
DB 0 ;AC000;;no synonyms
old_com_DATAbits_control LABEL BYTE ;AC000;
DW simple_string+optional ;AC000;
DW 0 ;AC000;;don't capitalize, leave colon
DW result ;AC000;
DW DATA_values ;AC000;
DB 0 ;AC000;
old_com_STOPbits_control LABEL BYTE ;AC000;
DW simple_string+optional ;AC000;
DW 0 ;AC000;;don't capitalize, leave colon
DW result ;AC000;
DW STOP_values ;AC000;
DB 0 ;AC000;
old_com_RETRY_control LABEL BYTE ;AC000;
DW simple_string+optional ;AC000;;all that is legal for RETRY is P for old com format
DW 0 ;AC000;;don't capitalize, never need to display to user
DW result ;AC000;
DW RETRY_values ;AC000;
DB 0 ;AC000;
com_value LABEL BYTE ;AC000;"COM" for mutant_com_parmsx
DB include_string_list ;AC000;have list of strings
DB 0 ;AC000;
DB 0 ;AC000;no number choices
DB 1 ;AC000;just "COM"
DB COM_item_tag ;AC000;
DW OFFSET COM_str ;AC000;
first_pos_control LABEL BYTE ;AN000;initialized for first_parm_case
match_flags DW simple_string+optional ;*** +ignore_colon *** ;AN000;2011, all that is legal for non-/status first parm
function_flags DW 0010H ;AN000;don't capitalize, remove colon at end
DW result ;AN000;
values_ptr DW first_pos_values ;AN000;
DB 0 ;AN000;no keywords as positionals
second_pos_control LABEL BYTE ;AN000;initialized for first_parm_case
match_flags2 DW simple_string+optional+ignore_colon ;AN000;2011, all that is legal for non-/status first parm
function_flags2 DW 0010H ;AN000;don't capitalize, remove colon at end
DW result ;AN000;
values_ptr2 DW second_pos_values ;AN000;
DB 0 ;AN000;;no keywords as positionals
third_pos_control LABEL BYTE ;AN000;initialized for first_parm_case
match_flags3 DW simple_string+optional+ignore_colon ;AN000;2011, all that is legal for non-/status first parm
function_flags3 DW 0010H ;AN000;don't capitalize, remove colon at end
DW result ;AN000;
values_ptr3 DW third_pos_values ;AN000;
DB 0 ;AN000;;no keywords as positionals
first_lpt_pos_control LABEL BYTE ;AN000;chars per line
DW simple_string+optional ;AN000;2001, all that is legal for chars per line
DW 0000H ;AN000;don't capitalize
DW result ;AN000;
DW first_lpt_pos_values ;AN000;
DB 0 ;AN000;no keywords as positionals
second_lpt_pos_control LABEL BYTE ;AN000;lines per inch
DW simple_string+optional ;AN000;2001, all that is legal for chars per line
DW 0000H ;AN000;don't capitalize
DW result ;AN000;
DW second_lpt_pos_values ;AN000;
DB 0 ;AN000;;no keywords as positionals
third_lpt_pos_control LABEL BYTE ;AN000;P
DW simple_string+optional ;AN000;2001, all that is legal for retry settings
DW 0000H ;AN000;don't capitalize
DW result ;AN000;
DW third_lpt_pos_values ;AN000;
DB 0 ;AN000;;no keywords as positionals
BAUD_control LABEL BYTE ;AN000;used for positional and keyword form
DW simple_string ;AN000;required
DW 0 ;AN000;don't capitalize
DW result ;AN000;
DW BAUD_values ;AN000;
DB 1 ;AN000;;only one form of the keyword
BAUD_equal DB "BAUD=",0 ;AN000;
parity_equal_control LABEL BYTE ;AN000;initialized for first_parm_case
DW simple_string ;AN000;n, o, even, m, space etc are strings
DW 0 ;AN000;don't capitalize, leave colon
DW result ;AN000;
DW PARITY_values ;AN000;
DB 2 ;two ways to specify it
parity_equal DB "PARITY=",0 ;AN000;
par_equal DB "PAR=",0 ;AN000;
DATA_equal_control LABEL BYTE ;AN000;
DW simple_string
DW 0 ;AN000;;don't capitalize, leave colon
DW result ;AN000;
DW DATA_values ;AN000;
DB 1 ;AN000;
data_equal DB "DATA=",0 ;AN000;
STOP_equal_control LABEL BYTE ;AN000;
DW simple_string ;AN000;
DW 0 ;AN000;;don't capitalize, leave colon
DW result ;AN000;
DW STOP_values ;AN000;
DB 1 ;AN000;
stop_equal DB "STOP=",0 ;AN000;
RETRY_equal_control LABEL BYTE ;AN000;
DW simple_string ;AN000;;all that is legal for RETRY is on and off
DW 0 ;AN000;;don't capitalize, never need to display to user
DW result ;AN000;
DW RETRY_values ;AN000;
DB 1 ;AN000;
retry_equal_str DB "RETRY=",0 ;AN000;
PREPARE_equal_control LABEL BYTE ;AN000;
prepare_equal_match_flags LABEL WORD ;AN000;
DW numeric+complex+filespec ;AN000;has to be complex at first, then numbers and filespec inside the parens
DW capitalize ;AN000;capitalize the filespec
DW result ;AN000;
DW prepare_values ;AN000;
DB 2 ;AN000;
prepare_equal DB "PREPARE=",0 ;AN000;
prep_equal DB "PREP=",0 ;AN000;
SELECT_equal_control LABEL BYTE ;AN000;
DW numeric ;AN000;range of codepage numbers
DW 0 ;AN000;don't capitalize, leave colon
DW result ;AN000;
DW SELECT_values ;AN000;
DB 2 ;AN000;no keywords as positionals
select_equal DB "SELECT=",0 ;AN000;
sel_equal DB "SEL=",0 ;AN000;
DELAY_equal_control LABEL BYTE ;AN000;
DW numeric ;AN000; ;takes less space than number definitions
DW 0 ;AN000; ;don't capitalize, leave colon
DW result ;AN000;
DW DELAY_values ;AN000;
DB 2 ;AN000;
del_equal DB "DEL=",0 ;AN000;
delay_equal DB "DELAY=",0 ;AN000;
RATE_equal_control LABEL BYTE ;AN000;
DW numeric ;AN000;
DW 0 ;AN000; ;don't capitalize, leave colon
DW result ;AN000;
DW RATE_values ;AN000;
DB 1 ;AN000;
rate_equal DB "RATE=",0 ;AN000;
LINES_equal_control LABEL BYTE ;AN000;
LINES_match_flag DW numeric ;AN000; ;setup for CON, changed if find LPTX
DW 0 ;AN000; ;don't capitalize, leave colon
DW result ;AN000;
LINES_value_ptr DW CON_LINES_values ;AN000;
DB 1 ;AN000;
lines_equal DB "LINES=",0 ;AN000;
COLUMNS_equal_control LABEL BYTE ;AN000;
COLUMNS_match_flag DW numeric ;AN000; ;setup for CON changed when find LPTX
DW 0 ;AN000; ;don't capitalize, leave colon
DW result ;AN000;
COLUMNS_value_ptr DW CON_COLUMNS_values ;AN000;setup for CON, changed if find LPTX
DB 2 ;AN000;
COLUMNS_equal DB "COLUMNS=",0 ;AN000;printer keyword
COLS_equal DB "COLS=",0 ;AN000;
LPT1_colon_equal_control LABEL BYTE ;AN000;
DW simple_string+ignore_colon ;AN000;COM?[:] is all that is valid
DW 0 ;AN000;;don't capitalize, leave colon
DW result ;AN000;
DW reroute_values ;AN000;
DB 1 ;AN000;
LPT1_colon_equal DB "LPT1:=",0 ;AN000;
LPT1_equal_control LABEL BYTE ;AN000;
DW simple_string+ignore_colon ;AN000;COM?[:] is all that is valid
DW 0 ;AN000;don't capitalize, leave colon
DW result ;AN000;
DW reroute_values ;AN000;
DB 1 ;AN000;
LPT1_equal DB "LPT1=",0 ;AN000;
LPT2_colon_equal_control LABEL BYTE ;AN000;
DW simple_string+ignore_colon ;AN000;COM?[:] is all that is valid
DW 0 ;AN000;don't capitalize, leave colon
DW result ;AN000;
DW reroute_values ;AN000;
DB 1 ;AN000;
LPT2_colon_equal DB "LPT2:=",0 ;AN000;
LPT2_equal_control LABEL BYTE ;AN000;
DW simple_string+ignore_colon ;AN000;;COM?[:] is all that is valid
DW 0 ;AN000;don't capitalize, leave colon
DW result ;AN000;
DW reroute_values ;AN000;
DB 1 ;AN000;
LPT2_equal DB "LPT2=",0 ;AN000;
LPT3_colon_equal_control LABEL BYTE ;AN000;
DW simple_string+ignore_colon ;AN000;COM?[:] is all that is valid
DW 0 ;AN000;don't capitalize, leave colon
DW result ;AN000;
DW reroute_values ;AN000;
DB 1 ;AN000;
LPT3_colon_equal DB "LPT3:=",0 ;AN000;
LPT3_equal_control LABEL BYTE ;AN000;
DW simple_string+ignore_colon ;AN000;COM?[:] is all that is valid
DW 0 ;AN000;don't capitalize, leave colon
DW result ;AN000;
DW reroute_values ;AN000;
DB 1 ;AN000;
LPT3_equal DB "LPT3=",0 ;AN000;
first_con_pos_control LABEL BYTE ;AN000;
DW simple_string ;AN000;CP, code, codepage
DW 0 ;AN000;don't capitalize, leave colon
DW result ;AN000;
DW OFFSET first_CON_pos_values ;AN000;
DB 0 ;AN000;no synonyms
second_con_pos_control LABEL BYTE ;AN000;
DW simple_string ;AN000;REFRESH
DW 0 ;AN000;don't capitalize, leave colon
DW result ;AN000;
DW OFFSET second_CON_pos_values ;AN000;
DB 0 ;AN000;no synonyms
first_old_con_pos_control LABEL BYTE ;AN000;
DW simple_string+numeric ;AN000;r, l or screen lines request
DW 0 ;AN000;don't capitalize
DW result ;AN000;
DW OFFSET first_old_CON_pos_values ;AN000;
DB 0 ;AN000;no synonyms
second_old_con_pos_control LABEL BYTE ;AN000;
DW simple_string+optional ;AN000;T
DW 0 ;AN000;don't capitalize
DW result ;AN000;
DW OFFSET second_old_CON_pos_values ;AN000;
DB 0 ;AN000;no synonyms
first_old_CON_pos_values LABEL BYTE ;all valid forms of shift direction, and screen line values ;AN000;
DB include_string_list ;AN000;have list of strings
DB 0 ;no number ranges ;AN000;
DB number_of_CON_lines_numbers ;number of rows choices;AN000;
DB twentyfive_item_tag ;AN000;
DD 25 ;AN000;
DB fourtythree_item_tag ;AN000;
DD 43 ;AN000;
DB fifty_item_tag ;AN000;
DD 50 ;AN000;
DB number_of_shift_forms ;number of shift strings AN000;
start_shift_forms LABEL BYTE ;AN000;
DB R_item_tag ;AN000;
DW OFFSET R_str ;AN000;
DB L_item_tag ;AN000;
DW OFFSET L_str ;AN000;
number_of_shift_forms EQU ($ - start_shift_forms)/3 ;3 bytes per entry;AN000;
second_old_CON_pos_values LABEL BYTE ;all valid forms of T ;AN000;
DB include_string_list ;AN000;have list of strings
DB 0 ;no number ranges ;AN000;
DB 0 ;no number list ;AN000;
DB number_of_T_forms ;number of T strings AN000;
start_T_forms LABEL BYTE ;AN000;
DB T_item_tag ;AN000;
DW OFFSET T_str ;AN000;
number_of_T_forms EQU ($ - start_T_forms)/3 ;3 bytes per entry;AN000;
first_CON_pos_values LABEL BYTE ;all valid forms of codepage;AN000;
DB include_string_list ;AN000;have list of strings
DB 0 ;no number ranges ;AN000;
DB 0 ;no number list ;AN000;
DB number_of_CP_forms ;number of cp strings AN000;
start_CP_forms LABEL BYTE ;AN000;
;codepage strings
DB CODEPAGE_item_tag ;AN000;
DW OFFSET CODE_str ;AN000;
DB CODEPAGE_item_tag ;AN000;
DW OFFSET CODEPAGE_str ;AN000;
DB CODEPAGE_item_tag ;AN000;
DW OFFSET CP_str ;AN000;
;invalid choice, included for usable error reporting: if come across refresh right after CON then issue invalid number of parms
DB REFRESH_item_tag ;AC007;
DW OFFSET REF_str ;AC007;
DB REFRESH_item_tag ;AC007;
DW OFFSET REFRESH_str ;AC007;
number_of_CP_forms EQU ($ - start_CP_forms)/3 ;3 bytes per entry;AN000;
second_CON_pos_values LABEL BYTE ;all valid forms of REFRESH;AN000;
DB include_string_list ;AN000;have list of strings
DB 0 ;no number ranges ;AN000;
DB 0 ;no number list ;AN000;
DB number_of_REFRESH_forms ;number of REFRESH strings AN000;
start_REFRESH_forms LABEL BYTE ;AN000;
DB REFRESH_item_tag ;AN000;
DW OFFSET REF_str ;AN000;
DB REFRESH_item_tag ;AN000;
DW OFFSET REFRESH_str ;AN000;
number_of_REFRESH_forms EQU ($ - start_REFRESH_forms)/3 ;3 bytes per entry;AN000;
BAUD_values LABEL BYTE ;AN000;;all valid baud rates
DB include_string_list ;AN000;have list of numbers and two strings
DB 0 ;AN000;
DB 0 ;AN000;no numeric representations
DB number_of_baud_strings ;AN000;number of baud rates that are being used for other parameters also
start_baud_strings LABEL BYTE ;AN000;
DB oneten_item_tag ;AN000;
DW OFFSET oneten_str ;AN000;
DB oneten_item_tag ;AN000;
DW OFFSET eleven_str ;AN000;;"11" first two chars of 110
DB onefifty_item_tag ;AN000;
DW OFFSET fifteen_str ;AN000;
DB onefifty_item_tag ;AN000;
DW OFFSET onefifty_str ;AN000;
DB threehundred_item_tag ;AN000;
DW OFFSET thirty_str ;AN000;
DB threehundred_item_tag ;AN000;
DW OFFSET threehundred_str ;AN000;
DB sixhundred_item_tag ;AN000;
DW OFFSET sixty_str ;AN000;
DB sixhundred_item_tag ;AN000;
DW OFFSET sixhundred_str ;AN000;
DB twelvehundred_item_tag ;AN000;
DW OFFSET twelve_str ;AN000;
DB twelvehundred_item_tag ;AN000;
DW OFFSET twelvehundred_str ;AN000;
DB twentyfourhundred_item_tag ;AN000;
DW OFFSET twentyfour_str ;AN000;24 is also a typamatic rate
DB twentyfourhundred_item_tag ;AN000;
DW OFFSET twentyfourhundred_str ;AN000;
DB fourtyeighthundred_item_tag ;AN000;
DW OFFSET fourtyeight_str ;AN000;
DB fourtyeighthundred_item_tag ;AN000;
DW OFFSET fourtyeighthundred_str ;AN000;
DB ninetysixhundred_item_tag ;AN000;
DW OFFSET ninetysix_str ;AN000;
DB ninetysixhundred_item_tag ;AN000;
DW OFFSET ninetysixhundred_str ;AN000;
DB nineteentwohundred_item_tag ;AN000;;item tag
DW OFFSET nineteentwohundred_str ;AN000;;pointer to string
DB nineteentwohundred_item_tag ;AN000;;item tag
DW OFFSET nineteen_point_two_str ;AN000;
DB nineteentwohundred_item_tag ;AN000; ;item tag
DW OFFSET nineteen_str ;AN000; ;used for RATE= also
DB nineteentwohundred_item_tag ;AN000; ;item tag
DW OFFSET nineteen_point_two_K_str ;AN000;pointer to string "19.2K"
number_of_baud_strings EQU ($ - start_baud_strings)/3 ;AN000;3 bytes per entry
PARITY_values LABEL BYTE ;AN000;all valid paritys
DB include_string_list ;AN000;have list of strings
DB 0 ;AN000;
DB 0 ;AN000;;no number choices
DB number_of_paritys ;AN000;;number of valid paritys
start_paritys LABEL BYTE ;AN000;
DB none_item_tag ;AN000;
DW OFFSET N_str ;AN000;
DB none_item_tag ;AN000;
DW OFFSET NONE_str ;AN000;
DB even_item_tag ;AN000;
DW OFFSET EVEN_str ;AN000;
DB even_item_tag ;AN000;
DW OFFSET E_str ;AN000;
DB odd_item_tag ;AN663;
DW OFFSET O_str ;AN663;
DB odd_item_tag ;AN000;
DW OFFSET ODD_str ;AN000;
DB MARK_item_tag ;AN663;
DW OFFSET m_str ;AN663;
DB MARK_item_tag ;AN000;
DW OFFSET mark_str ;AN000;
DB SPACE_item_tag ;AN663;
DW OFFSET s_str ;AN663;
DB SPACE_item_tag ;AN000;
DW OFFSET space_str ;AN000;
number_of_paritys EQU ($ - start_paritys)/3 ;AN000;3 bytes per entry
DATA_values LABEL BYTE ;AN000;all valid DATA values
DB include_string_list ;AC663;have list of numbers
DB 0 ;AN000;no number ranges
DB 0 ;AN000;no number choices
DB number_of_databits ;AN000;string choices
start_databits LABEL BYTE ;AN000;
DB five_item_tag ;AN000;
DW OFFSET five_str ;AN000;
DB six_item_tag ;AN000;
DW OFFSET six_str ;AN000;
DB seven_item_tag ;AN000;
DW OFFSET seven_str ;AN000;
DB eight_item_tag ;AN000;
DW OFFSET eight_str ;AN000;
number_of_databits EQU ($ - start_databits)/3 ;AN000;3 bytes per entry
STOP_values LABEL BYTE ;AN000;;all valid stop bits
DB include_string_list ;AN000;have list of numbers and list of strings
DB 0 ;AN000;
DB 0 ;AN000; ;no number choices
DB number_of_stopbit_strings ;AN000;;choices in string form
start_stopbit_strings LABEL BYTE ;AN000;
DB one_item_tag ;AN000;
DW OFFSET one_str ;AN000;
DB one_point_five_item_tag ;AN000;
DW OFFSET one_point_five_str ;AN000;
DB two_item_tag ;AN000;
DW OFFSET two_str ;AN000;
number_of_stopbit_strings EQU ($ - start_stopbit_strings)/3 ;AN000;3 bytes per entry
RETRY_values LABEL BYTE ;AN000;;all valid RETRY settings
DB include_string_list ;AN000;have list of strings
DB 0 ;AN000;
DB 0 ;AN000;;no number choices
DB number_of_retry_settings ;AN000;
start_retry_settings LABEL BYTE ;AN000;
DB B_item_tag ;AN000;
DW OFFSET B_str ;AN000;
DB E_item_tag ;AN000;
DW OFFSET E_str ;AN000;
DB R_item_tag ;AN000;
DW OFFSET R_str ;AN000;
DB NONE_item_tag ;AN663;
DW OFFSET N_str ;AN663;
DB NONE_item_tag ;AN000;
DW OFFSET NONE_str ;AN000;
DB P_item_tag ;AN000;
DW OFFSET P_str ;AN000;
number_of_retry_settings EQU ($ - start_retry_settings)/3 ;AN000;3 bytes per entry
PREPARE_values LABEL BYTE ;AN000;almost any numeric value is valid
DB ranges_only ;AN000;;have range of numbers
DB 1 ;AN000;;one range
DB codepage_item_tag ;AN000;
DD min_codepage_value ;AN000;
DD max_codepage_value ;AN000;
SELECT_values LABEL BYTE ;AN000;all valid baud rates
DB ranges_only ;AN000;;have range of numbers
DB 1 ;AN000;
DB codepage_item_tag ;AN000;;item tag for the range
DD min_codepage_value ;AN000;
DD max_codepage_value ;AN000;
DELAY_values LABEL BYTE ;AN000;;all valid delay rates
DB ranges_only ;AN000;;have range of numbers
DB 1 ;AN000;;1 range
DB range_item_tag ;AN000;;don't ever need this item tag
DD 1 ;AN000;;smallest valid delay value
DD 4 ;AN000;;largest valid delay value
RATE_values LABEL BYTE ;AN000;;all valid typamatic rates
DB ranges_only ;AN000;;have range of numbers
DB 1 ;AN000;;1 range
DB range_item_tag ;AN000;;never used
DD 1 ;AN000;;smallest valid rate
DD 32 ;AN000;;largest valid rate
CON_COLUMNS_values LABEL BYTE ;AN000;all valid columns values for the screen
DB include_number_list ;AN000; ;have list of numbers
DB 0 ;AN000;only numeric representations
DB number_of_CON_columns_numbers ;AN000;choices represented as numbers
start_CON_columns_numbers LABEL BYTE ;AN000;
DB fourty_item_tag ;AN000;
DD 40 ;AN000;
DB eighty_item_tag ; ;AN000;
DD 80 ;AN000;numbers because used in call to IOCTL
number_of_CON_columns_numbers EQU ($ - start_CON_columns_numbers)/5 ;5 bytes per entry;AN000;
CON_LINES_values LABEL BYTE ;all valid LINES= values for the screen;AN000;
DB include_number_list ;have list of numbers;AN000;
DB 0 ;AN000;
DB number_of_CON_lines_numbers ; number ch;AN000;
start_CON_lines_numbers LABEL BYTE ;AN000;
DB twentyfive_item_tag ;AN000;
DD 25 ;AN000;
DB fourtythree_item_tag ;AN000;
DD 43 ;AN000;
DB fifty_item_tag ;AN000;
DD 50 ;AN000;
number_of_CON_lines_numbers EQU ($ - start_CON_lines_numbers)/5 ;5 bytes per entry;AN000;
LPT_COLUMNS_values LABEL BYTE ;AN000;all valid columns values for parallel printers
DB include_string_list ;AN000;;have list of strings
DB 0 ;AN000;
DB 0 ;AN000;no numeric representations
DB number_of_lpt_columns_strings ;AN000;;choices represented as strings
start_LPT_columns_strings LABEL BYTE ;AN000;
DB eighty_item_tag ; ;AN000;
DW OFFSET eighty_str ;AN000;;strings because values also used as positional parms
DB onethirtytwo_item_tag ;AN000;
DW OFFSET onethirtytwo_str ;AN000;
number_of_LPT_columns_strings EQU ($ - start_LPT_columns_strings)/3 ;3 bytes per entry;AN000;
LPT_LINES_values LABEL BYTE ;AN000;all valid LINES= values for the screen
DB include_string_list ;AN000;have list of strings
DB 0 ;AN000;
DB 0 ;AN000; ;no number choices
DB number_of_LPT_lines_strings ;AN000;
start_LPT_lines_strings LABEL BYTE ;AN000;
DB six_item_tag ;AN000;;for printer
DW OFFSET six_str ;AN000;
DB eight_item_tag ;AN000;;for printer
DW OFFSET eight_str ;AN000;
number_of_LPT_lines_strings EQU ($ - start_LPT_lines_strings)/3 ;AN000;3 bytes per entry
reroute_values LABEL BYTE ;AN000;;all valid destination devices for parallel printer reroute
DB include_string_list ;AN000; ;have list of numbers and one string
DB 0 ;AN000;
DB 0 ;AN000;;no number choices
DB number_of_reroute_strings ;AN000;
start_reroute_strings LABEL BYTE ;AN000;
DB COM1_item_tag ;AN000;
DW OFFSET COM1_str ;AN000;
DB COM2_item_tag ;AN000;
DW OFFSET COM2_str ;AN000;
DB COM3_item_tag ;AN000;
DW OFFSET COM3_str ;AN000;
DB COM4_item_tag ;AN000;
DW OFFSET COM4_str ;AN000;
number_of_reroute_strings EQU ($ - start_reroute_strings)/3 ;AN000;3 bytes per entry
Sw_control LABEL BYTE ;AN000;
DW 0 ;AN000;no values allowed on /STATUS
function_flag DW 0 ;AN000;no values allowed on /STATUS
DW result ;AN000;same buffer as for other parms
DW Sw_values ;AN000;
num_synonyms DB 3 ;AN000;3 ways to specify /STATUS
slash_sta DB "/STA",0 ;AN000;
slash_stat DB "/STAT",0 ;AN000;
slash_status DB "/STATUS",0 ;AN000;
Sw_values LABEL BYTE ;AN000;
DB 0 ;AN000;no values allowed on /STATUS
first_pos_values LABEL BYTE ;AN000;value list for all positional parameters that appear first
DB include_string_list ;AN000; ;have string values
DB 0 ;AN000;numerics treated as strings
DB 0 ;AN000;no number choices
DB number_of_first_positional_strings ;AN000;
start_first_positional_strings LABEL BYTE ;used to calculate previous field;AN000;
;screen modes
DB BW40_item_tag ;AC000;
DW OFFSET BW40_str ;AC000;
DB BW80_item_tag ;AC000;
DW OFFSET BW80_str ;AC000;
DB CO40_item_tag ;AC000;
DW OFFSET CO40_str ;AC000;
DB CO80_item_tag ;AC000;
DW OFFSET CO80_str ;AC000;
DB MONO_item_tag ;AC000;
DW OFFSET MONO_str ;AC000;
DB fourty_item_tag ;AC000;
DW OFFSET fourty_str ;AC000;
DB eighty_item_tag ;AC000;
DW OFFSET eighty_str ;AC000;
DB con_item_tag ;AN000;
DW OFFSET con_str ;AN000;
;com port names
DB COM1_item_tag ;AN000;
DW OFFSET COM1_str ;AN000;
DB COM2_item_tag ;AN000;
DW OFFSET COM2_str ;AN000;
DB COM3_item_tag ;AN000;
DW OFFSET COM3_str ;AN000;
DB COM4_item_tag ;AN000;
DW OFFSET COM4_str ;AN000;
;printer port names
DB PRN_item_tag ;AN000;
DW OFFSET PRN_str ;AN000;
DB LPT1_item_tag ;AN000;
DW OFFSET LPT1_str ;AN000;
DB LPT2_item_tag ;AN000;
DW OFFSET LPT2_str ;AN000;
DB LPT3_item_tag ;AN000;
DW OFFSET LPT3_str ;AN000;
;LPT special cases
DB LPT1132_item_tag ;AN000;
DW OFFSET LPT1132_str;AN000;
DB LPT2132_item_tag ;AN000;
DW OFFSET LPT2132_str;AN000;
DB LPT3132_item_tag ;AN000;
DW OFFSET LPT3132_str;AN000;
DB LPT180_item_tag ;AN000;
DW OFFSET LPT180_str ;AN000;
DB LPT280_item_tag ;AN000;
DW OFFSET LPT280_str ;AN000;
DB LPT380_item_tag ;AN000;
DW OFFSET LPT380_str ;AN000;
number_of_first_positional_strings EQU ($ - start_first_positional_strings)/3 ;each entry is 3 bytes (byte, word);AN000;
second_pos_values LABEL BYTE ;AN000;;value list for all positional parameters that appear second
DB include_string_list ;AN000; ;have string values
DB 0 ;AN000;numerics treated as strings
DB 0 ;AN000;no number choices
DB number_of_second_positional_strings ;AN000;
start_second_positional_strings LABEL BYTE ;used to calculate previous field;AN000;
;codepage strings
DB CODEPAGE_item_tag ;AN000;
DW OFFSET CODE_str ;AN000;
DB CODEPAGE_item_tag ;AN000;
DW OFFSET CODEPAGE_str ;AN000;
DB CODEPAGE_item_tag ;AN000;
DW OFFSET CP_str ;AN000;
;invalid choice, included for usable error reporting: if come across refresh right after CON then issue invalid number of parms
DB REFRESH_item_tag ;AC007;
DW OFFSET REF_str ;AC007;
DB REFRESH_item_tag ;AC007;
DW OFFSET REFRESH_str ;AC007;
;shift directions
DB L_item_tag ;AN000;
DW OFFSET L_str ;AN000;
DB R_item_tag ;AN000;
DW OFFSET R_str ;AN000;
;columns values
; DB eighty_item_tag ;AN000;
; DW OFFSET eighty_str ;AN000; ;strings because values also used as positional parms
DB onethirtytwo_item_tag;AN000;
DW OFFSET onethirtytwo_str ;AN000;
number_of_second_positional_strings EQU ($ - start_second_positional_strings)/3 ;each entry is 3 bytes (byte, word);AN000;
third_pos_values LABEL BYTE ;AN000;value list for all positional parameters that appear third
DB include_string_list ;AN000; ;have string values
DB 0 ;AN000;numerics treated as strings
DB 0 ;AN000;no number choices
DB number_of_third_positional_strings ;AN000;
start_third_positional_strings LABEL BYTE ;used to calculate previous field;AN000;
number_of_third_positional_strings EQU ($ - start_third_positional_strings)/3 ;each entry is 3 bytes (byte, word);AN000;
first_lpt_pos_values LABEL BYTE ;AN000;value list for all possible chars per line
DB include_string_list ;AN000; ;have string values
DB 0 ;AN000;numerics treated as strings
DB 0 ;AN000;no number choices
DB number_of_first_lpt_positional_strings ;AN000;
start_first_lpt_positional_strings LABEL BYTE ;used to calculate previous field;AN000;
DB eighty_item_tag
DW OFFSET eighty_str
DB onethirtytwo_item_tag
DW OFFSET onethirtytwo_str ;AN000;
DB CODEPAGE_item_tag
DW OFFSET CODE_str ;AN000;
DB CODEPAGE_item_tag ;AN000;
DW OFFSET CODEPAGE_str ;AN000;
DB CODEPAGE_item_tag ;AN000;
DW OFFSET CP_str ;AN000;
;invalid choice, included for usable error reporting: if come across refresh right after CON then issue invalid number of parms
DB REFRESH_item_tag ;AC007;
DW OFFSET REF_str ;AC007;
DB REFRESH_item_tag ;AC007;
DW OFFSET REFRESH_str ;AC007;
number_of_first_lpt_positional_strings EQU ($ - start_first_lpt_positional_strings)/3 ;each entry is 3 bytes (byte, word);AN000;
second_lpt_pos_values LABEL BYTE ;AN000;value list for all possible lines per inch
DB include_string_list ;AN000; ;have string values
DB 0 ;AN000;numerics treated as strings
DB 0 ;AN000;no number choices
DB number_of_second_lpt_positional_strings ;AN000;
start_second_lpt_positional_strings LABEL BYTE ;used to calculate previous field;AN000;
DB eight_item_tag ;AN000;
DW OFFSET eight_str ;AN000;
DB six_item_tag ;AN000;
DW OFFSET six_str ;AN000;
DB REFRESH_item_tag ;AN000;
DW OFFSET REF_str ;AN000;
DB REFRESH_item_tag ;AN000;
DW OFFSET REFRESH_str ;AN000;
number_of_second_lpt_positional_strings EQU ($ - start_second_lpt_positional_strings)/3 ;3 bytes per entry (byte,word);AN000;
third_lpt_pos_values LABEL BYTE ;AN000;value list for all possible retry settings
DB include_string_list ;AN000; ;have string values
DB 0 ;AN000;no numeric ranges
DB 0 ;AN000;no number choices
DB number_of_third_lpt_positional_strings ;AN000;
start_third_lpt_positional_strings LABEL BYTE ;used to calculate previous field;AN000;
DB B_item_tag ;AN000;
DW OFFSET B_str ;AN000;
DB E_item_tag ;AN000;
DW OFFSET E_str ;AN000;
DB R_item_tag ;AN000;
DW OFFSET R_str ;AN000;
DB NONE_item_tag ;AN663;
DW OFFSET N_str ;AN663;
DB NONE_item_tag ;AN000;
DW OFFSET NONE_str ;AN000;
DB OFF_item_tag ;AN000;
DW OFFSET OFF_str ;AN000;
DB P_item_tag
DW OFFSET P_str
number_of_third_lpt_positional_strings EQU ($ - start_third_lpt_positional_strings)/3 ;each entry is 3 bytes (byte, word);AN000;
;strings
;AN000;
zero_str DB "0",0 ;AN000;
one_str DB "1",0 ;AN000;
one_point_five_str DB "1.5",0 ;AN000;
two_str DB "2",0 ;AN000;
three_str DB "3",0 ;AN000;
four_str DB "4",0 ;AN000;
five_str DB "5",0 ;AN000; ;data bit, typamatic rate
six_str DB "6",0 ;AN000;
seven_str DB "7",0 ;AN000;
eight_str DB "8",0 ;AN000;
nine_str DB "9",0 ;AN000;
eleven_str DB "11",0 ;AN000; ;first two chars of 110
twelve_str DB "12",0 ;AN000;
fifteen_str DB "15",0 ;AN000; ;abbreviated form of 150, 15 is also a RATE= candidate
nineteen_str DB "19",0 ;AN000; ;used for baud rates and RATE=
nineteen_point_two_str DB "19.2",0 ;AN000;
nineteen_point_two_K_str DB "19.2K",0 ;AN000; ;mutant baud rate
twentyfour_str DB "24",0 ;AN000; ;24 is also a typamatic rate
thirty_str DB "30",0 ;AN000;
fourty_str DB "40",0 ;AN000;
fourtyeight_str DB "48",0 ;AN000;
sixty_str DB "60",0 ;AN000;
eighty_str DB "80",0 ;AN000;
ninetysix_str DB "96",0 ;AN000;
oneten_str DB "110",0 ;AN000;
onethirtytwo_str DB "132",0 ;AN000;
onefifty_str DB "150",0 ;AN000;
threehundred_str DB "300",0 ;AN000;
sixhundred_str DB "600",0 ;AN000;
twelvehundred_str DB "1200",0 ;AN000;
twentyfourhundred_str DB "2400",0 ;AN000;
fourtyeighthundred_str DB "4800",0 ;AN000;
ninetysixhundred_str DB "9600",0 ;AN000;
nineteentwohundred_str DB "19200",0 ;AN000;
B_str DB "B",0 ;AN000;
BW40_str DB "BW40",0 ;AN000;
BW80_str DB "BW80",0 ;AN000;
CO40_str DB "CO40",0 ;AN000;
CO80_str DB "CO80",0 ;AN000;
CODE_str DB "CODE",0 ;AN000;
CODEPAGE_str DB "CODEPAGE",0;AN000;
COM_str DB "COM",0 ;AN000;
start_COM1_str LABEL BYTE ;AN000; ;used to calculate len_COMX_str, see invoke
COM1_str DB "COM1",0 ;AN000;
len_COMX_str EQU $ - start_COM1_str;AN000; ;all COMX strings are the same length
COM2_str DB "COM2",0 ;AN000;
COM3_str DB "COM3",0 ;AN000;
COM4_str DB "COM4",0 ;AN000;
CON_str DB "CON",0
len_CON_str EQU ($ - (OFFSET CON_str)) ;AN000;
CP_str DB "CP",0 ;AN000;
E_str DB "E",0 ;RETRY=setting ;AN000;
EVEN_str DB "EVEN",0 ;AN000;
L_str DB "L",0 ;AN000;
start_LPT1_str LABEL BYTE ;used to calculate len_LPTX_str, see invoke ;AN000;
LPT1_str DB "LPT1",0 ;AN000;
len_LPTX_str EQU $ - start_LPT1_str ;all LPTX strings are the same length ;AN000;
LPT2_str DB "LPT2",0 ;AN000;
LPT3_str DB "LPT3",0 ;AN000;
LPT1132_str DB "LPT1132",0 ;AN000;
LPT2132_str DB "LPT2132",0 ;AN000;
LPT3132_str DB "LPT3132",0 ;AN000;
LPT180_str DB "LPT180",0 ;AN000;
LPT280_str DB "LPT280",0 ;AN000;
LPT380_str DB "LPT380",0 ;AN000;
M_str DB "M",0
MARK_str DB "MARK",0 ;AN000;
MONO_str DB "MONO",0 ;AN000;
N_str DB "N",0 ;AN000;
NONE_str DB "NONE",0 ;AN000;
O_str DB "O",0 ;AN000;
ODD_str DB "ODD",0 ;AN000;
OFF_str DB "OFF",0 ;AN000;
ON_str DB "ON",0 ;AN000;
P_str DB "P",0 ;AN000;
PRN_str DB "PRN",0 ;AN000;
R_str DB "R",0 ;AN000;
REF_str DB "REF",0 ;AN000;
REFRESH_str DB "REFRESH",0 ;AN000;
S_str DB "S",0
SPACE_str DB "SPACE",0 ;AN000;
T_str DB "T",0 ;AN000;
result result_def<> ;AN000;
parm_lst parm_list_entry max_parms DUP (<>) ;AN000;
;� �
;������������������������������������ D A T A �����������������������������������������ͼ
;
;******************************************************************************************
;-------------------------------------------------------------------------------
;�������������������������������������������������������������������������������
;�
;� SEARCH_ITEM_TAGS
;� ----------------
;� Search the item tags in input value list for the input item tag.
;�
;�
;�
;�
;�
;�
;� INPUT: i_CL - first item tag in the group
;� search_stop - last item_tag in the group, the sentinal for the REPEAT
;� loop.
;�
;�
;� RETURN: match_found indicates that the item tag returned by the parser was
;� found in the group passed in.
;�
;�
;� MESSAGES: none
;�
;�
;�
;�
;� REGISTER
;� USAGE: To be determined at I2 time.
;�
;�
;� CONVENTIONS:
;�
;�
;�
;�
;� ASSUMPTIONS:
;�
;�
;� SIDE EFFECT:
;�
;�
;�������������������������������������������������������������������������������
search_item_tags PROC NEAR ;AN000;
MOV match_found,false ;AN000;
.REPEAT
.IF <parm_list[current_parm_DI].item_tag EQ i_CL> THEN ;AN000;
MOV match_found,true ;AN000;
MOV i_CL,last_databit_item_tag ;AN000;set end of loop trigger
.ENDIF ;AN000;
INC i_CL ;AN000;
.UNTIL <i_CL GT search_stop> ;AN000;
RET
search_item_tags ENDP ;AN000;
;-------------------------------------------------------------------------------
;�������������������������������������������������������������������������������
;�
;� CHECK_FOR_KEYWORD
;� ---------------------
;�
;� Scan the list of keywords (OFFSETS) looking for a match with
;� parm_list[current_parm_DI].keyword_switch_ptr.
;�
;�
;�
;� INPUT: uses global variables.
;�
;�
;� RETURN: match_found is set to true if a match is found.
;�
;�
;� MESSAGES: none
;�
;�
;�
;� REGISTER
;� USAGE: DX - loop index
;� SI - displacement into the list of pointers
;� CX - holder of pointer to keywords for compare
;�
;�
;�
;� CONVENTIONS:
;�
;�
;�
;�
;�
;�
;� ASSUMPTIONS: The list of con_keyword pointers is consecutive words.
;� number_of_keywords has the number of OFFSETS in the list
;� start_of_keyword_ptrs has the first OFFSET in the list and can
;� be addressed off of.
;�
;�
;�
;� SIDE EFFECT: DL - lost
;� SI - lost
;� CX - lost
;� match_found - lost
;�
;�
;�������������������������������������������������������������������������������
check_for_keyword PROC NEAR ;AN000;
MOV match_found,false ;AN000;
MOV SI,0 ;AN000;
MOV DL,0 ;AN000;;index for the loop
.WHILE <DL LT number_of_keywords> AND ;AN000;;check each pointer in the list
.WHILE <match_found EQ false> DO ;AN000;
MOV CX,start_of_keyword_ptrs[SI] ;AN000;
.IF <parm_list[current_parm_DI].keyword_switch_ptr EQ CX> THEN ;AN000;IF synonym ptr=CON keyword ptr THEN
MOV match_found,true ;AN000;
.ENDIF ;AN000;
INC SI ;AN000; ;AN000;
INC SI ;AN000; ;AN000;
INC DL ;AN000;;increment loop counter
.ENDWHILE ;AN000;
RET ;AN000;
check_for_keyword ENDP ;AN000;
;-------------------------------------------------------------------------------
setup_invalid_parameter PROC NEAR ;AN000;
PUBLIC setup_invalid_parameter
MOV message,OFFSET CRLF ;AN000;the common message doesn't have a CR,LF in it and all my other messages do
PUSH parser_return_code_AX ;AC006;AX destroyed by sysdispmsg
display message ;AN000;
POP parser_return_code_AX
MOV BP,command_line ;AN000;BP points to end of current (invalid) parm
.IF <<BYTE PTR [BP]> NE end_of_line_char_0D> AND ;AN000;IF a whitespace char or comma in the string
.IF <<BYTE PTR [BP]> NE end_of_line_char_00> THEN ;AN000;THEN
DEC BP ;AN000;don't include the delimeter in the display of the invalid parm
.ENDIF
MOV BYTE PTR [BP],0 ;AN000;make the string an ASCIIZ
;offending_parameter is where the text of the bad parm is,
;offending_parameter_ptr is the address of offending_parameter By incrementing
;offending_parameter_ptr the first characters of the text string are skipped.
;This is done to skip leading whitespace.
MOV BP,offending_parameter_ptr ;AC006;BP=>first char in the text string
.WHILE <<BYTE PTR [BP]> EQ tab> OR ;AC006;WHILE the char in the text string
.WHILE <<BYTE PTR [BP]> EQ " "> DO ;AC006; is white space DO
INC offending_parameter_ptr ;AC006;point past the whitespace char
INC BP ;AC006;index next char in the string
.ENDWHILE ;AC006;
.IF <parser_return_code_AX EQ syntax_error_rc> THEN ;AN000;syntax error, like "RETRY= E"
MOV message,OFFSET syntax_error ;AN000;
PUSH offending_parameter_ptr ;AN000;
POP syntax_error_ptr ;AN000;point to the offending parameter
.ELSEIF <parser_return_code_AX EQ not_in_switch_list> THEN ;AN000;
MOV message,OFFSET Invalid_switch
.ELSE
MOV message,OFFSET Invalid_parameter ;AN000;user mispelled, misordered etc.
.ENDIF ;AN000;
MOV noerror,false ;AN000;
RET
setup_invalid_parameter ENDP ;AN000;
;-------------------------------------------------------------------------------
setup_for_not_supported PROC NEAR ;AC002;prepare replacable parm for "Function not supported on this machine - ????".
MOV CX,offending_parameter_ptr;AN000;
MOV not_supported_ptr,CX ;AN000;point to string describing what is not supported for message
MOV BP,command_line ;AN000;BP points to end of current (invalid) parm
.IF <<BYTE PTR [BP]> NE end_of_line_char_0D> AND ;AN000;IF a whitespace char or comma in the string
.IF <<BYTE PTR [BP]> NE end_of_line_char_00> THEN ;AN000;THEN
DEC BP ;AN000;don't include the delimeter in the display of the invalid parm
.ENDIF
MOV BYTE PTR [BP],0 ;AN000;make the string an ASCIIZ
MOV message,OFFSET function_not_supported ;AN000;"Function not supported on the computer - mark"
MOV noerror,false ;AN000;
MOV looking_for,eol
RET
setup_for_not_supported ENDP ;AC002;
;�������������������������������������������������������������������������������
;�
;� PARSE_PARAMETERS
;� ----------------
;�
;� All parameters entered on the command line are reduced to a list of values
;� which completely describes the parms. The syntactic and semantic correctness
;� will be checked. The routines that use the lists created by this routine
;� can have complete trust in the validity of the parms.
;�
;� Most of the states of looking_for allow null, even if it is not mentioned in
;� the name of the value looking_for is assigned.
;�
;�
;�
;�
;�
;�
;�
;�
;�
;�
;� INPUT: none, uses global variables.
;�
;�
;� RETURN: noerror is set to false if an error is encountered.
;�
;�
;� MESSAGES: "Invalid parameter 'bdprm'", where "bdprm" is the first 5 or less
;� characters of the parameter that is incorrect or unexpected.
;�
;� "Must specify COM1, COM2, COM3 or COM4"
;�
;� "Illegal device name"
;�
;� "Invalid baud rate specified"
;�
;�
;�
;�
;� REGISTER
;� USAGE: To be determined at I2 time.
;�
;�
;� CONVENTIONS: "looking_for" indicates the valid possibilities for the next parm.
;�
;� "current_parm" refers to the parm just returned. It can be an
;� item tag, a type.
;�
;� When "/STATUS" is a valid possibility it is checked for even
;� though the value of "looking_for" may not indicate it as a
;� choice.
;�
;� When possible the parser control blocks will be modified at
;� the case where looking_for is being checked for rather than
;� where looking_for was set. This will save code when more than
;� one place sets looking_for to the same state.
;�
;�
;�
;�
;� ASSUMPTIONS: The parser control blocks are setup to be the following:
;� seperators are defaults and colon (:)
;� match_flags=2011 (simple string, ignore colon, optional)
;� function_flags=0
;� keyword/switch list has only /STATUS
;� nval (number of value definitions) is 3
;� Initially no number choices. Most numeric values will treated as strings.
;� This is because for most of them the numeric value doesn't
;� mean anything. Since we do not want to restrict the choices
;� code pages they cannot be enumerated, so a range will be used.
;� The list of strings in the values block contains all the
;� device names, all the screen modes, all the status qualifiers,
;� and all numeric values that have no meaning in binary form,
;� can be enumerated, or are non-integer.
;�
;�
;� SIDE EFFECT:
;�
;�
;�������������������������������������������������������������������������������
parse_parameters PROC ;AN000;
;determine if on a PS/2 for checking COMx parameters
.IF <machine_type EQ PS2Model30> OR ;AC002;
.IF <machine_type EQ PS2Model50> OR ;AC002;
.IF <machine_type EQ PS2Model60> OR ;AC002;
.IF <machine_type EQ PS2Model80> THEN ;AC002;IF the machine is a PS/2 THEN
MOV type_of_machine,PS2 ;AC002;set flag
.ENDIF
MOV looking_for,first_parm ;AN000;looking_for:=first_parm
.WHILE <eol_found NE true> AND NEAR ;AN000;
.WHILE <noerror EQ true> NEAR DO ;AN000;WHILE (NOT EOL) AND noerror=true DO
; CASE looking_for=
;calculate the displacement for the jump to appropriate case
XOR AX,AX ;AN000;
MOV AL,max_looking_for ;AN000;see the list of equates for looking_for
SUB AL,looking_for ;AN000;AX=byte displacement into table of OFFSETS
SHL AX,1 ;AN000;each displacement is 2 bytes
MOV SI,AX ;AN000;SI=appropriate displacement into table of offsets
JMP jump_table1[SI] ;AN000;jump to case
jump_table1 LABEL WORD ;AN000; ;these entries must be in same order as the values in list of equates for looking_for
DW OFFSET codepage_case ;AN000;
DW OFFSET codepage_prms_case ;AN000;
DW OFFSET COM_keyword_case ;AN000;
DW OFFSET com_keyword_or_baud_case ;AN000;
DW OFFSET CON_keyword_case ;AN000;
DW OFFSET con_kwrd_status_or_cp_case ;AN000;
DW OFFSET databits_or_null_case ;AN000;
DW OFFSET device_name_or_eol_case ;AN000;
DW OFFSET eol_case ;AN000;
DW OFFSET first_parm_case ;AN000;
DW OFFSET li_or_null_case ;AN000;
DW OFFSET P_case ;AN000;
DW OFFSET parity_or_null_case ;AN000;
DW OFFSET prn_kw_status_cp_cl_null_case ;AN000;
DW OFFSET sd_or_dl_case ;AN000;
DW OFFSET sd_or_dl_or_eol_case ;AN000;
DW OFFSET status_or_eol_case ;AN000;
DW OFFSET stopbits_or_null_case ;AN000;
DW OFFSET T_or_eol_case ;AN000;
com_keyword_or_baud_case: ;AN000;
PUBLIC com_keyword_or_baud_case
;The com keywords are in "com_parmsx", as well as the values for the
;positional and keyword forms of the com parameters. If
;keyword_switch_ptr comes back from parse_parm nonzero then a valid
;com keyword or /STATUS was found.
CALL parse_parm ;AN000;/status allowed
;CASE current_parm=
; /status:
.IF <parser_return_code_AX EQ no_error> AND ;AN000;
.IF <parm_list[current_parm_DI].keyword_switch_ptr EQ <OFFSET slash_sta>> OR ;AN000;
.IF <parm_list[current_parm_DI].keyword_switch_ptr EQ <OFFSET slash_stat>> OR ;AC004;
.IF <parm_list[current_parm_DI].keyword_switch_ptr EQ <OFFSET slash_status>> THEN ;AN000;
; MOV slash_status,deleted ;AN000;make it so /status again is an error,also deletes /STA
; MOV slash_stat,deleted ;AN000;
; MOV slash_sta,deleted ;AN000;
MOV looking_for,eol ;AN000;eol only valid
MOV request_type,com_status ;AN000;
BREAK 1 ;AN000;
.ENDIF ;AN000;
; eol:
.IF <parser_return_code_AX EQ end_of_command_line> THEN ;AN000;
MOV request_type,com_status ;AN000;
MOV eol_found,true ;AN000;
BREAK 1 ;AN000;
.ENDIF ;AN000;
; com_keyword:
.IF <parser_return_code_AX EQ no_error> AND ;AN000;
.IF <parm_list[current_parm_DI].keyword_switch_ptr NE 0> THEN ;AN000;wasn't /STATUS so must be a keyword
.IF <parm_list[current_parm_DI].keyword_switch_ptr EQ <OFFSET baud_equal>> THEN ;AN000;IF synonym ptr=> BAUD= THEN
MOV baud_specified,true ;AN000;
.ENDIF ;AN000;
delete_parser_value_list_entry keywords,current_parm ;AN000;
MOV looking_for,com_keyword ;AN000;
MOV parms_form,keyword ;AN000;tell analyze_and_invoke how to look at the parms
BREAK 1 ;AN000;
.ENDIF ;AN000;
; baud: ;found a number that is a valid baud, know that have old com style com request
.IF <parser_return_code_AX EQ no_error> THEN ;AN000;IF have a baud rate THEN (none of above, must be baud rate)
.IF <parm_list[current_parm_DI].item_tag EQ nineteentwohundred_item_tag> THEN ;AC002;IF PS2 only baud rate AND
MOV new_com_initialize,true
.IF <type_of_machine NE PS2> THEN ;AC002;not on PS/2
CALL setup_for_not_supported ;AC002;set up for "Function not supported on this computer" message
.ENDIF ;AN000;
.ENDIF ;AN008;
;AD008; .ELSE
MOV looking_for,parity_or_null ;AN000;
MOV request_type,initialize_com_port ;AN000;
;AD008; .ENDIF
BREAK 1 ;AN000;
.ELSE ;AN000;
; otherwise:
CALL setup_invalid_parameter ;AN000;
; BREAK 1
.ENDIF
ENDCASE_1:
BREAK 0 ;AN000;
com_keyword_case:
;At this point the com keywords are in the keyword list, the only valid
;parms that can follow are com keywords. Assume that one and only one
;com keyword has been found and removed from the list of keywords.
PUBLIC com_keyword_case
MOV parms.parmsx_ptr,OFFSET com_keywords_parmsx ;AN000;only com keywords are in the control blocks
MOV i_CL,1 ;AN000;
.WHILE <i_CL LE number_of_com_keywords> AND NEAR ;AN000;one iteration more than number of parms left so will find eol
.WHILE <eol_found EQ false> AND NEAR ;AN000;
.WHILE <noerror EQ true> DO NEAR ;AN000;
.SELECT ;AC002;check for PS/2 specific parms
.WHEN <parm_list[current_parm_DI].keyword_switch_ptr EQ <OFFSET baud_equal>> THEN ;AC002;IF synonym ptr=> BAUD= THEN
.IF <parm_list[current_parm_DI].item_tag EQ nineteentwohundred_item_tag> THEN ;AC002;IF PS2 only baud rate AND
MOV new_com_initialize,true
.IF <type_of_machine NE PS2> THEN ;AC002;not on PS/2
CALL setup_for_not_supported ;AC002;set up for "Function not supported on this computer" message
.ENDIF
.ENDIF
.WHEN <parm_list[current_parm_DI].keyword_switch_ptr EQ <OFFSET parity_equal>> THEN ;AC002;IF parity= THEN
.IF <parm_list[current_parm_DI].item_tag EQ mark_item_tag> OR ;AC002;IF PS2 only parity
.IF <parm_list[current_parm_DI].item_tag EQ space_item_tag> THEN ;AC002;IF PS2 only parity AND
MOV new_com_initialize,true
.IF <type_of_machine NE PS2> THEN ;AC002;not on PS/2
CALL setup_for_not_supported ;AC002;set up for "Function not supported on this computer" message
.ENDIF
.ENDIF
.WHEN <parm_list[current_parm_DI].keyword_switch_ptr EQ <OFFSET data_equal>> THEN ;AC002;IF data= THEN
.IF <parm_list[current_parm_DI].item_tag EQ five_item_tag> OR ;AC002;IF PS2 only data bits
.IF <parm_list[current_parm_DI].item_tag EQ six_item_tag> THEN ;AC002;IF PS2 only data bits AND
MOV new_com_initialize,true
.IF <type_of_machine NE PS2> THEN ;AC002;not on PS/2
CALL setup_for_not_supported ;AC002;set up for "Function not supported on this computer" message
.ENDIF
.ENDIF
.WHEN <parm_list[current_parm_DI].keyword_switch_ptr EQ <OFFSET stop_equal>> THEN ;AC002;IF stop= THEN
.IF <parm_list[current_parm_DI].item_tag EQ one_point_five_item_tag> THEN ;AC002;IF PS2 only stop bits AND
MOV new_com_initialize,true
.IF <type_of_machine NE PS2> THEN ;AC002;not on PS/2
CALL setup_for_not_supported ;AC002;set up for "Function not supported on this computer" message
.ENDIF
.ENDIF
.ENDSELECT
PUSH CX ;save the loop index
CALL parse_parm ;AN000;
POP CX
.IF <noerror EQ true> AND
.IF <parser_return_code_AX EQ no_error> THEN ;AN000;
.IF <parm_list[current_parm_DI].keyword_switch_ptr EQ <OFFSET baud_equal>> THEN ;AN000;IF synonym ptr=> BAUD= THEN
MOV baud_specified,true ;AN000;
.ENDIF ;AN000;
delete_parser_value_list_entry keywords,current_parm ;AN000;
INC i_CL ;AN000;
.ELSEIF <parser_return_code_AX EQ end_of_command_line> THEN ;AN000;
.IF <baud_specified EQ true> THEN ;AN000;
MOV request_type,initialize_com_port ;AN000;
.ELSE ;AN000;
MOV message,OFFSET baud_rate_required ;AN000;
MOV noerror,false
.ENDIF ;AN000;
MOV eol_found,true ;AN000;
.ELSE NEAR ;AN000;
CALL setup_invalid_parameter ;AN000;
.ENDIF ;AN000;
.ENDWHILE ;AN000;
MOV looking_for,eol ;AN000;if haven't already encountered an error then check for extraneous parms
BREAK 0 ;AN000;com_keyword
status_or_eol_case:
; status_or_eol: ;Have found the only or the last status qualifier, must find /STATUS or eol_found NExt
;Assume that /STATUS is the only switch in the appropriate parser control block
;Assume that request_type has already been set
CALL parse_parm ;AN000;
.IF <parm_list[current_parm_DI].keyword_switch_ptr EQ <OFFSET slash_sta>> OR ;AN000;
.IF <parm_list[current_parm_DI].keyword_switch_ptr EQ <OFFSET slash_stat>> OR ;AC004;
.IF <parm_list[current_parm_DI].keyword_switch_ptr EQ <OFFSET slash_status>> THEN ;AN000;found /status
MOV looking_for,eol ;AN000;
.ELSEIF <parser_return_code_AX EQ end_of_command_line> THEN ;AN000;encountered EOL
MOV eol_found,true ;AN000;
.ELSE ;AN000;
CALL setup_invalid_parameter ;AN000;
.ENDIF
BREAK 0 ;status_or_eol ;AN000;
parity_or_null_case:
PUBLIC parity_or_null_case
;the parser control blocks have paritys as strings
;modify parser control blocks list of valid paritys based on the
;machine type.
CALL parse_parm ;AN000;
.IF <parser_return_code_AX EQ operand_missing> THEN ;AN000;valid null
MOV looking_for,databits_or_null ;AN000;can't have baud,,eol
.ELSE ;AN000;
; CASE current_parm=
; eol:
.IF <parser_return_code_AX EQ end_of_command_line> THEN ;AN000;valid
MOV request_type,initialize_com_port
MOV eol_found,true ;AN000;
BREAK 5 ;AN000;
.ENDIF
; parity:
.IF <parser_return_code_AX EQ no_error> THEN ;AN000;IF have a parity THEN (none of above, must be parity)
MOV looking_for,databits_or_null ;AN000;
.IF <parm_list[current_parm_DI].item_tag EQ mark_item_tag> OR ;AN000;
.IF <parm_list[current_parm_DI].item_tag EQ space_item_tag> THEN ;AN000;
MOV new_com_initialize,true
.IF <type_of_machine NE PS2> THEN ;AN000;IF not Roundup or later
CALL setup_for_not_supported ;AC002;set up for "Function not supported on this computer" message
.ENDIF ;AN000; ;AN000;
.ENDIF ;AN000;
.ELSE
; otherwise:
CALL setup_invalid_parameter ;AN000;
; BREAK
.ENDIF ;AN000;
ENDCASE_5: ;current_parm
.ENDIF ;AN000;
BREAK 0 ;AN000;parity_or_null
databits_or_null_case:
PUBLIC databits_or_null_case
;parser control blocks have all databits (as strings).
;modify parser control blocks to handle list of valid databits
;based on the machine type.
;AC002; .IF <type_of_machine NE PS2> THEN ;AN000;IF not Roundup or later
;AC002; MOV five_str,deleted ;delete parser value list entry ;AN000;
;AC002; MOV six_str,deleted ;delete_parser_value_list_entry ;AN000;
;AC002; .ENDIF ;AN000;
;the parser control blocks have data bits valid for this machine
CALL parse_parm ;AN000;
.IF <parser_return_code_AX EQ operand_missing> THEN ;AN000;valid null
MOV looking_for,stopbits_or_null ;can't have databits,,eol
.ELSE ;AN000;
; CASE current_parm=
; eol:
.IF <parser_return_code_AX EQ end_of_command_line> THEN ;AN000;valid
MOV request_type,initialize_com_port ;AN000;
MOV eol_found,true ;AN000;
BREAK 6 ;AN000;
.ENDIF ;AN000;
; databits:
.IF <parser_return_code_AX EQ no_error> THEN ;AN000;IF have a parity THEN (none of above, must be parity)
MOV looking_for,stopbits_or_null ;AN000;
.IF <parm_list[current_parm_DI].item_tag EQ five_item_tag> OR ;AC002;
.IF <parm_list[current_parm_DI].item_tag EQ six_item_tag> THEN ;AC002;
MOV new_com_initialize,true
.IF <type_of_machine NE PS2> THEN ;AC002;IF not Roundup or later
CALL setup_for_not_supported ;AC002;set up for "Function not supported on this computer" message
.ENDIF ;AC002; ;AN000;
.ENDIF ;AC002;
; BREAK 6 ;AN000;
.ELSE ;AN000;
; otherwise:
CALL setup_invalid_parameter ;AN000;
; BREAK
.ENDIF
ENDCASE_6: ;current_parm
.ENDIF ;AN000;
BREAK 0 ;AN000;databits_or_null
stopbits_or_null_case:
PUBLIC stopbits_or_null_case
;parser control blocks have all stopbits (as strings).
;modify parser control blocks to handle list of valid stopbits
;based on the machine type.
;AC002; .IF <type_of_machine NE PS2> THEN ;AN000;IF not Roundup or later
;AC002; MOV one_point_five_str,deleted ;delete_parser_value_list_entry ;AN000;
;AC002; .ENDIF ;AN000;
CALL parse_parm ;AN000;
.IF <parser_return_code_AX EQ operand_missing> THEN ;AN000;valid null
MOV looking_for,P ;AN000;no null just before eol
.ELSE ;AN000;
; CASE current_parm=
; eol:
.IF <parser_return_code_AX EQ end_of_command_line> THEN ;AN000;valid
MOV BYTE PTR request_type,initialize_com_port ;AN000;
MOV eol_found,true ;AN000;
BREAK 7 ;AN000;
.ENDIF
; stopbits:
.IF <parser_return_code_AX EQ no_error> THEN ;AN000;IF have a parity THEN (none of above, must be parity)
MOV looking_for,P ;AN000;P or eol valid next
.IF <parm_list[current_parm_DI].item_tag EQ one_point_five_item_tag> THEN ;AC002;
MOV new_com_initialize,true
.IF <type_of_machine NE PS2> THEN ;AC002;IF not Roundup or later
CALL setup_for_not_supported ;AC002;set up for "Function not supported on this computer" message
.ENDIF ;AC002; ;AN000;
.ENDIF ;AC002;
.ELSE
; otherwise:
CALL setup_invalid_parameter ;AN000;
; BREAK
.ENDIF
ENDCASE_7: ;current_parm
.ENDIF ;AN000;
BREAK 0 ;AN000;stopbits_or_null
P_case: ;P or eol valid
PUBLIC P_case
;P is in the parser control blocks' list of strings.
CALL parse_parm ;AN000;
; CASE current_parm=
; eol:
.IF <parser_return_code_AX EQ end_of_command_line> THEN ;AN000;valid
MOV eol_found,true ;AN000;
BREAK 8 ;AN000;
.ENDIF
; P:
.IF <parser_return_code_AX EQ no_error> THEN ;AN000;found one of: p,e,b,r,n,none,off
MOV looking_for,eol ;AN000;found last positional
MOV retry_requested,true
.ELSE
; otherwise:
CALL setup_invalid_parameter ;AN000;
.ENDIF
ENDCASE_8: ;current_parm
BREAK 0 ;AN000;P
;m
prn_kw_status_cp_cl_null_case:
PUBLIC prn_kw_status_cp_cl_null_case
;Have encountered only LPTX so far, so any printer stuff including codepage
;requests can follow. All necessary keywords and switches are in the control blocks.
CALL parse_parm ;AN000;
; CASE current_parm=
; LPT_mode_keyword: ;nothing but printer keywords allowed
.IF <parser_return_code_AX EQ no_error> AND NEAR ;AN000;
; .IF <parm_list[current_parm_DI].keyword_switch_ptr EQ <OFFSET COLUMNS_equal>> OR ;AN000;
; .IF <parm_list[current_parm_DI].keyword_switch_ptr EQ <OFFSET COLS_equal>> OR ;AN000;
; .IF <parm_list[current_parm_DI].keyword_switch_ptr EQ <OFFSET lines_equal>> OR ;AN000;
; .IF <parm_list[current_parm_DI].keyword_switch_ptr EQ <OFFSET retry_equal_str>> THEN ;AN000;found a printer keyword
check_for_lpt_keyword ;check for COLS= or LINES= or RETRY=, return results in match_found
.IF <match_found EQ true> THEN NEAR
delete_parser_value_list_entry keywords,current_parm ;AN000;
MOV parms_form,keyword ;AN000;indicate to modeprin how to deal with retry
CALL parse_parm ;AN000;
MOV DL,1 ;AN000;one keyword found so far
.REPEAT
; CASE return_code=
; LPT_keyword:
.IF <parser_return_code_AX EQ no_error> AND ;AN000;
PUSH DX ;save loop index
check_for_lpt_keyword ;return results in match_found
POP DX
.IF <match_found EQ true> THEN
.IF <parm_list[current_parm_DI].keyword_switch_ptr EQ <OFFSET retry_equal_str>> AND
.IF <parm_list[current_parm_DI].item_tag NE NONE_item_tag> THEN
MOV retry_requested,true ;set up for rescode
.ENDIF
delete_parser_value_list_entry keywords,current_parm ;AN000;
INC DL ;AN000;found another keyword
BREAK 9 ;AN000;
.ENDIF
; eol:
.IF <parser_return_code_AX EQ end_of_command_line> THEN ;AN000;valid
;had at least one keyword
MOV request_type,initialize_printer_port ;AN000;
MOV eol_found,true ;AN000;
BREAK 9 ;AN000;
.ENDIF
; otherwise: ;wrong type of keywords, /STATUS etc.
CALL setup_invalid_parameter ;AN000;
; BREAK
ENDCASE_9:
PUSH DX
CALL parse_parm ;AN000;
POP DX
.UNTIL <DL EQ number_of_LPT_keywords> OR ;AN000;
.UNTIL <eol_found EQ true> OR ;AN000;
.UNTIL <noerror EQ false> ;AN000;
; .IF <eol_found NE true> AND
.IF <noerror EQ true> AND ;AN000;
.IF <DL EQ number_of_LPT_keywords> THEN ;AN000;
MOV looking_for,eol ;AN000;check for extraneous parms
.ENDIF ;AN000;
BREAK 10
.ENDIF ;AN000;LPT_keyword
; /STATUS:
.IF <parser_return_code_AX EQ no_error> AND ;make sure don't have /STA:value ;AN000;
.IF <parm_list[current_parm_DI].keyword_switch_ptr EQ <OFFSET slash_sta>> OR ;AN000;
.IF <parm_list[current_parm_DI].keyword_switch_ptr EQ <OFFSET slash_stat>> OR ;AC004;
.IF <parm_list[current_parm_DI].keyword_switch_ptr EQ <OFFSET slash_status>> THEN ;AN000;found /STATUS
MOV looking_for,eol ;AN000;look for RETRY or codepage
MOV slash_status,deleted ;AN000;
MOV slash_stat,deleted ;AN000;
MOV slash_sta,deleted ;AN000;
MOV request_type,printer_status ;AN000;
BREAK 10 ;AN000;keyword
.ENDIF ;/STATUS found ;AN000;
; codepage:
.IF <parm_list[current_parm_DI].keyword_switch_ptr EQ 0> AND ;AC007;wasn't SEL=cpnum or PREP=cpnum
.IF <parm_list[current_parm_DI].item_tag EQ codepage_item_tag> THEN ;AN000;IF found "codepage" or "cp" THEN
MOV looking_for,codepage_prms ;AN000;
MOV codepage_str,deleted ;AN000;
MOV code_str,deleted ;AN000;
MOV cp_str,deleted ;AC007;
BREAK 10 ;AN000;
.ENDIF ;AN000;
; cl:
.IF <parm_list[current_parm_DI].item_tag EQ onethirtytwo_item_tag> OR ;AN000;
.IF <parm_list[current_parm_DI].item_tag EQ eighty_item_tag> THEN ;AN000;
MOV REFRESH_str,deleted ;AC007;no codepage stuff legal
MOV REF_str,deleted ;AC007;
MOV SEL_equal,deleted ;AN007;
MOV SELECT_equal,deleted ;AN007;
MOV PREP_equal,deleted ;AN007;
MOV PREPARE_equal,deleted ;AN007;
MOV slash_status,deleted ;AN007;
MOV slash_stat,deleted ;AN007;
MOV slash_sta,deleted ;AN007;
MOV looking_for,li_or_null ;AN000;
MOV request_type,old_initialize_printer_port ;AN000;found enough to know that it isn't status or keyword
BREAK 10 ;AN000;
.ENDIF ;AN000;
; eol:
.IF <parser_return_code_AX EQ end_of_command_line> THEN ;AN000;valid
MOV request_type,turn_off_reroute ;compatible with previous MODE ;AN000;
MOV eol_found,true ;AN000;
BREAK 10 ;AN000;
.ENDIF ;AN000;
; codepage_keyword_out_of_order:
.IF <parm_list[current_parm_DI].keyword_switch_ptr EQ <OFFSET PREPARE_equal>> OR ;AC007;if got here and have
.IF <parm_list[current_parm_DI].keyword_switch_ptr EQ <OFFSET PREP_equal>> OR ;AC007;one of the codepage
.IF <parm_list[current_parm_DI].keyword_switch_ptr EQ <OFFSET SEL_equal>> OR ;AC007;keywords then user
.IF <parm_list[current_parm_DI].keyword_switch_ptr EQ <OFFSET SELECT_equal>> THEN ;AC007;forgot "CP"
MOV message,OFFSET Invalid_number_of_parameters ;AC007;
MOV noerror,false ;AC007;
BREAK 10 ;AN000;CON_keyword
.ENDIF
; REFRESH_out_of_order: ;AC007;forgot to include "CP"
.IF <parm_list[current_parm_DI].item_tag EQ REFRESH_item_tag> THEN ;AC007;
MOV message,OFFSET Invalid_number_of_parameters ;AC007;
MOV noerror,false ;AC007;
BREAK 10
.ENDIF ;AC007;
; null:
.IF <parser_return_code_AX EQ no_error> AND ;AN000;
.IF <parm_list[current_parm_DI].item_tag EQ unspecified> THEN ;AN007;valid null
MOV REFRESH_str,deleted ;AC007;no codepage stuff legal
MOV REF_str,deleted ;AC007;
MOV SEL_equal,deleted ;AN007;
MOV SELECT_equal,deleted ;AN007;
MOV PREP_equal,deleted ;AN007;
MOV PREPARE_equal,deleted ;AN007;
MOV slash_status,deleted ;AN007;
MOV slash_stat,deleted ;AN007;
MOV slash_sta,deleted ;AN007;
MOV looking_for,li_or_null ;AN000;
MOV request_type,old_initialize_printer_port ;AN000;found enough to know that it isn't status or keyword
; otherwise:
.ELSE ;AN000;
CALL setup_invalid_parameter ;AN000;
; BREAK ;AN000;
.ENDIF ;AN000;
ENDCASE_10: ;current_parm= ;AN000;
BREAK 0 ;AN000;prn_kw_status_cp_cl_null_case:
li_or_null_case: ;look for lines per inch or null, eol valid
PUBLIC li_or_null_case
CALL parse_parm ;AN000;
; CASE current_parm=
; li:
.IF <parm_list[current_parm_DI].item_tag EQ six_item_tag> OR ;AN000;
.IF <parm_list[current_parm_DI].item_tag EQ eight_item_tag> THEN ;AN000;IF found 6 or 8 THEN
MOV looking_for,P ;AN000;
BREAK 11
.ENDIF
; eol:
.IF <parser_return_code_AX EQ end_of_command_line> THEN ;AN000;valid
MOV request_type,old_initialize_printer_port ;AN000;
MOV eol_found,true ;AN000;
BREAK 11 ;AN000;
.ENDIF
; null:
.IF <parser_return_code_AX EQ no_error> AND ;AN000;
.IF <parm_list[current_parm_DI].item_tag EQ unspecified> THEN ;AN007;valid null
MOV looking_for,P ;AN000;
BREAK 11 ;AN000;
.ENDIF
; otherwise:
CALL setup_invalid_parameter ;AN000;
; BREAK
ENDCASE_11: ;current_parm ;AN000;
BREAK 0 ;AN000;li_or_null
;m
codepage_prms_case:
;The desired codepage parameters are in the parser control blocks, such
;as: the keywords, PREPARE, REFRESH, and /STATUS.
CALL parse_parm ;AN000;
; CASE current_parm=
; REFRESH:
.IF <parm_list[current_parm_DI].item_tag EQ REFRESH_item_tag> THEN ;AN000;
MOV request_type,codepage_refresh ;AN000;
MOV looking_for,eol
BREAK 12
.ENDIF
; PREPARE=:
;Have to parse ((cplist) [filename])
.IF <parm_list[current_parm_DI].keyword_switch_ptr EQ <OFFSET PREPARE_equal>> OR ;AN000;
.IF <parm_list[current_parm_DI].keyword_switch_ptr EQ <OFFSET PREP_equal>> THEN NEAR ;AN000;IF PREPARE= THEN
.IF <parm_list[current_parm_DI].parm_type EQ complx> THEN NEAR ;AN000;should have found ((cplist) filename)
PUSH SI ;AN000;save pointer to first char past the closing right paren
MOV AX,parm_list[current_parm_DI].value1 ;AN000;
MOV command_line,AX ;AN000;point at first char past the left paren
SUB DI,TYPE parm_list_entry ;AN000;not parm, just indication of complex, delete from parm list
MOV parms.parmsx_ptr,OFFSET prepare_equal_parmsx
MOV prepare_equal_match_flags,complex ;AN000;only thing valid next
CALL parse_parm ;AN000;
.IF <parser_return_code_AX EQ no_error> AND ;AN000;
.IF <parm_list[current_parm_DI].parm_type EQ complx> THEN ;AN000;assume have ((cplist) filename)
PUSH SI ;AN000;save pointer to first char past the closing right paren
MOV AX,parm_list[current_parm_DI].value1 ;AN000;
MOV command_line,AX ;AN000;point at first char past the left paren
SUB DI,TYPE parm_list_entry ;AN000;not parm, just indication of complex, delete from parm list
MOV prepare_equal_match_flags,numeric+optional ;AN000;number or delimeter only things valid next
MOV ordinal,0 ;AN000;zap parms count,make parser count codepage numbers
.REPEAT ;AN000;
CALL parse_parm ;AN000;
.IF <parser_return_code_AX EQ no_error> THEN ;AN000; ;AN000;
ADD des_start_packet.des_strt_pklen,2 ;increment size of parm block for another cp number
INC des_start_packet.des_strt_pknum ;increment number of cp numbers
ADD current_packet_cp_number,2 ;address next code page number slot
MOV SI,current_packet_cp_number
MOV BP,OFFSET des_start_packet
.IF <parm_list[current_parm_DI].item_tag EQ codepage_item_tag> THEN ;AN000;IF not skipped slot THEN
MOV DX,parm_list[current_parm_DI].value1 ;AN000;store the number if one specified for this slot
MOV [SI][BP].des_strt_pkcp1,DX ;put the number in the slot for the cp number
.ENDIF ;AN000;not valid skipped codepage number, i.e. not (,850,,865) for example
.ELSEIF <parser_return_code_AX EQ end_of_complex> THEN ;AN000;
SUB DI,TYPE parm_list_entry ;don't want an entry in the parm list for the zeroed out ")"
.ELSE
CALL setup_invalid_parameter ;AN000;
.ENDIF ;AN000;
.UNTIL <parser_return_code_AX EQ end_of_complex> OR ;AN000;came to end of the cplist
.UNTIL <noerror EQ false>
POP command_line ;AN000;resume just after the closing paren of (cplist), should be at ) or filename
.ELSE ;AN000;must be an error
MOV message,OFFSET invalid_number_of_parameters ;AN000;
MOV noerror,false ;AN000;
.ENDIF
.IF <noerror EQ true> THEN ;AN000;IF successfully broke down cplist and file name THEN
MOV prepare_equal_match_flags,filespec+optional ;AN000;only thing valid is filespec
MOV ordinal,0 ;AN000;don't need parser to count the parms anymore
MOV prepare_min_parms,0 ;AN000;filename is optional
; A filespec may be next so colon cannot be a delimeter.
modify_parser_control_block seperator_list,delete,colon ;AN000;want to find a keyword so don't stop on colons
CALL parse_parm ;AN000;
.IF <parser_return_code_AX EQ no_error> THEN ;AN000;
MOV AX,parm_list[current_parm_DI].value1 ;AN000;AX=OFFSET of filespec just encountered
MOV cp_cb.font_filespec,AX ;AN000;set up pointer to filespec for modecp
.ELSEIF <parser_return_code_AX EQ end_of_complex> THEN ;AN000;cartridge prepare, no filename
MOV des_start_packet.des_strt_pkfl,DES_STRT_FL_CART ; 0001H=CARTRIDGE PREPARE,
.ELSE ;AN000;
CALL setup_invalid_parameter ;AN000;
.ENDIF ;AN000;
MOV request_type,codepage_prepare ;AN000;if encountered an error won't continue anyways
.ENDIF ;AN000;
POP command_line ;AN000;continue parsing after the origional complex, should be eol
.ELSE ;AN000;
MOV message,OFFSET invalid_number_of_parameters ;AN000;should have found a complex
MOV noerror,false ;AN000;
.ENDIF
MOV looking_for,eol ;AN000;
BREAK 12 ;AN000;
.ENDIF
; SELECT=:
dummy1:
PUBLIC DUMMY1
.IF <parm_list[current_parm_DI].keyword_switch_ptr EQ <OFFSET SEL_equal>> OR ;AN000;
.IF <parm_list[current_parm_DI].keyword_switch_ptr EQ <OFFSET SELECT_equal>> THEN ;AN000;
.IF <parser_return_code_AX EQ no_error> THEN ;AN000;
MOV codepage_index_holder,current_parm_DI ;AN000;save index of the codepage parm list entry for invoke
MOV request_type,codepage_select ;AN000;
MOV looking_for,eol ;AN000;
.ELSE ;AN000;
CALL setup_invalid_parameter ;AN000;
.ENDIF
BREAK 12 ;AN000;
.ENDIF
; /STATUS:
.IF <parser_return_code_AX EQ no_error> AND ;make sure don't have /STA:value ;AN000;
.IF <parm_list[current_parm_DI].keyword_switch_ptr EQ <OFFSET slash_STA>> OR ;AN000;
.IF <parm_list[current_parm_DI].keyword_switch_ptr EQ <OFFSET slash_stat>> OR ;AC002;
.IF <parm_list[current_parm_DI].keyword_switch_ptr EQ <OFFSET slash_STATUS>> THEN ;AN000;
MOV request_type,codepage_status ;AN000;
;AX322; .IF <device_name EQ <OFFSET CON_str>> THEN
MOV looking_for,eol ;AC322;
;AX322; .ELSE
;AX322; MOV looking_for,eol ;AN000;
;AX322; .ENDIF
BREAK 12 ;AN000;
.ENDIF
; eol:
.IF <parser_return_code_AX EQ end_of_command_line> THEN ;AN000;
MOV request_type,codepage_status ;AN000;
MOV eol_found,true ;AN000;
BREAK 12 ;AN000;
.ENDIF
; otherwise:
CALL setup_invalid_parameter ;AN000;
; BREAK
ENDCASE_12: ;current_parm=
BREAK 0 ;AN000;
codepage_case: ;found PRN, only valid parms are CODEPAGE, and /STATUS
;/STATUS is in the the parser control blocks
CALL parse_parm ;AN000;
; CASE current_parm=
; CODEPAGE:
.IF <parm_list[current_parm_DI].keyword_switch_ptr EQ 0> AND ;AC007;wasn't SEL=cpnum or PREP=cpnum
.IF <parm_list[current_parm_DI].item_tag EQ codepage_item_tag> THEN ;AN000;IF found "codepage" or "cp" THEN
;set up for codepage_prms_case
; modify_parser_control_block keywords,addd,codepage_keywords ;AN000;codepage parms handler assumes keywords setup
MOV looking_for,codepage_prms ;AN000;
BREAK 13 ;AN000;
.ENDIF
; /STATUS: ;only CODEPAGE or end of line valid next
.IF <parser_return_code_AX EQ no_error> AND ;make sure don't have /STA:value ;AN000;
.IF <parm_list[current_parm_DI].keyword_switch_ptr EQ <OFFSET slash_STA>> OR ;AN000;
.IF <parm_list[current_parm_DI].keyword_switch_ptr EQ <OFFSET slash_stat>> OR ;AC004;
.IF <parm_list[current_parm_DI].keyword_switch_ptr EQ <OFFSET slash_STATUS>> THEN ;AN000;
CALL parse_parm ;AN000;
.IF <parm_list[current_parm_DI].item_tag EQ codepage_item_tag> THEN ;AN000;
MOV looking_for,eol ;AN000;
MOV status_request,true
MOV request_type,codepage_status ;AN000;
.ELSEIF <parser_return_code_AX EQ end_of_command_line> THEN ;AN000;
MOV eol_found,true ;AC005;
MOV status_request,true ;AC005;
MOV request_type,codepage_status ;AC005;
.ELSE ;AN000;
CALL setup_invalid_parameter ;AN000;
.ENDIF
BREAK 13 ;AN000;
.ENDIF
; eol:
.IF <parser_return_code_AX EQ end_of_command_line> THEN ;AN000;
MOV request_type,codepage_status ;AN000;
MOV eol_found,true ;AN000;
BREAK 13 ;AN000;
.ENDIF
; codepage_keyword_out_of_order:
.IF <parm_list[current_parm_DI].keyword_switch_ptr EQ <OFFSET PREPARE_equal>> OR ;AC007;if got here and have
.IF <parm_list[current_parm_DI].keyword_switch_ptr EQ <OFFSET PREP_equal>> OR ;AC007;one of the codepage
.IF <parm_list[current_parm_DI].keyword_switch_ptr EQ <OFFSET SEL_equal>> OR ;AC007;keywords then user
.IF <parm_list[current_parm_DI].keyword_switch_ptr EQ <OFFSET SELECT_equal>> THEN ;AC007;forgot "CP"
MOV message,OFFSET Invalid_number_of_parameters ;AC007;
MOV noerror,false ;AC007;
BREAK 13 ;AN000;CON_keyword
.ENDIF
; REFRESH_out_of_order: ;AC007;forgot to include "CP"
.IF <parm_list[current_parm_DI].item_tag EQ REFRESH_item_tag> THEN ;AC007;
MOV message,OFFSET Invalid_number_of_parameters ;AC007;
MOV noerror,false ;AC007;
; BREAK 13
.ELSE ;AC007;
; otherwise:
CALL setup_invalid_parameter ;AN000;
; BREAK
.ENDIF ;AC007;
ENDCASE_13:
BREAK 0 ;AN000;
con_kwrd_status_or_cp_case:
PUBLIC con_kwrd_status_or_cp_case
MOV parms.parmsx_ptr,OFFSET con_parmsx
CALL parse_parm ;AN000;
; CASE current_parm=
; codepage:
.IF <parm_list[current_parm_DI].keyword_switch_ptr EQ 0> AND ;AC007;wasn't SEL=cpnum or PREP=cpnum
.IF <parm_list[current_parm_DI].item_tag EQ codepage_item_tag> THEN ;AN000;IF found "codepage" or "cp" THEN
MOV looking_for,codepage_prms ;AN000;
BREAK 14 ;AN000;
.ENDIF
; eol:
.IF <parser_return_code_AX EQ end_of_command_line> THEN ;AN000;
MOV request_type,all_con_status ;AN000;found only CON on the command line
MOV eol_found,true ;AN000;
BREAK 14 ;AN000;
.ENDIF
; /STATUS:
.IF <parm_list[current_parm_DI].keyword_switch_ptr EQ <OFFSET slash_STA>> OR ;AN000;
.IF <parm_list[current_parm_DI].keyword_switch_ptr EQ <OFFSET slash_stat>> OR ;AC004;
.IF <parm_list[current_parm_DI].keyword_switch_ptr EQ <OFFSET slash_STATUS>> THEN ;AN000;
MOV slash_status,deleted ;AN000;
MOV slash_stat,deleted ;AN000;
MOV slash_sta,deleted ;AN000;
MOV request_type,all_con_status ;AN000;found only CON on the command line
MOV looking_for,eol ;AC665;have MODE CON /STATUS, must find eol now
BREAK 14 ;AN000;
.ENDIF
; con_keyword:
.IF <parser_return_code_AX EQ no_error> AND ;make sure invalid value not specified ;AN000;
.IF <parm_list[current_parm_DI].keyword_switch_ptr NE 0> THEN ;not pointing to /sta, not 0, must be a keyword
.IF <parm_list[current_parm_DI].keyword_switch_ptr EQ <OFFSET rate_equal>> OR ;AN000;
.IF <parm_list[current_parm_DI].keyword_switch_ptr EQ <OFFSET del_equal>> OR ;AN000;
.IF <parm_list[current_parm_DI].keyword_switch_ptr EQ <OFFSET delay_equal>> THEN ;AN000;
INC rate_and_delay_found ;found one, needs to be 2 before valid;AN000;
.ELSEIF <parm_list[current_parm_DI].keyword_switch_ptr EQ <OFFSET PREPARE_equal>> OR ;AC007;if got here and have
.IF <parm_list[current_parm_DI].keyword_switch_ptr EQ <OFFSET PREP_equal>> OR ;AC007;one of the codepage
.IF <parm_list[current_parm_DI].keyword_switch_ptr EQ <OFFSET SEL_equal>> OR ;AC007;keywords then user
.IF <parm_list[current_parm_DI].keyword_switch_ptr EQ <OFFSET SELECT_equal>> THEN ;AC007;forgot "CP"
MOV message,OFFSET Invalid_number_of_parameters ;AC007;
MOV noerror,false ;AC007;
.ELSE
.IF <parm_list[current_parm_DI].keyword_switch_ptr NE <OFFSET COLUMNS_equal>> AND ;AC007;
.IF <parm_list[current_parm_DI].keyword_switch_ptr NE <OFFSET COLS_equal>> AND ;AC007;
.IF <parm_list[current_parm_DI].keyword_switch_ptr NE <OFFSET lines_equal>> THEN ;AC007;
CALL setup_invalid_parameter ;AC007;keyword other than LINES=, COLS=, RATE= or DELAY= would require CP
.ENDIF ;AC007;and be handled above
.ENDIF ;AN000;
delete_parser_value_list_entry keywords,current_parm ;AN000;doesn't affect anything if invalid parm
MOV looking_for,CON_keyword ;AN000;doesn't affect anything if invalid parm
BREAK 14 ;AN000;CON_keyword
.ENDIF
; REFRESH: ;AC007;forgot to include "CP"
.IF <parm_list[current_parm_DI].item_tag EQ REFRESH_item_tag> THEN ;AC007;
MOV message,OFFSET Invalid_number_of_parameters ;AC007;
MOV noerror,false ;AC007;
; BREAK
.ELSE ;AC007;
; otherwise:
CALL setup_invalid_parameter ;AN000;
; BREAK
.ENDIF ;AC007;
ENDCASE_14:
BREAK 0 ;AN000;con_kwrd_status_or_cp_case:
con_keyword_case: ;found one, it has been deleted from the parser control blocks
PUBLIC con_keyword_case
MOV slash_status,deleted ;AN000;remove /STA /STAT and STATUS
MOV slash_stat,deleted ;AN000;
MOV slash_sta,deleted ;AN000;
MOV i_CL,1 ;AN000;
.WHILE <i_CL LT number_of_con_keywords> AND ;AN000;
.WHILE <eol_found EQ false> AND ;AN000;
.WHILE <noerror EQ true> DO ;AN000;
PUSH CX
CALL parse_parm ;AN000;
; CASE return_code=
; con_keyword:
.IF <parser_return_code_AX EQ no_error> AND ;make sure don't have /STA:value ;AN000;
.IF <parm_list[current_parm_DI].keyword_switch_ptr NE 0> THEN ;not 0, must be a keyword ;AN000;
.IF <parm_list[current_parm_DI].keyword_switch_ptr EQ <OFFSET rate_equal>> OR ;AN000;
.IF <parm_list[current_parm_DI].keyword_switch_ptr EQ <OFFSET del_equal>> OR ;AN000;
.IF <parm_list[current_parm_DI].keyword_switch_ptr EQ <OFFSET delay_equal>> THEN ;AN000;
INC rate_and_delay_found ;found one, needs to be 2 before valid;AN000;
.ENDIF
delete_parser_value_list_entry keywords,current_parm ;AN000;
INC i_CL ;AN000;
BREAK 15 ;AN000;
.ENDIF ;AN000;
; eol:
.IF <parser_return_code_AX EQ end_of_command_line> THEN ;AN000;
.IF <rate_and_delay_found EQ both> OR ;IF both OR neither found THEN
.IF <rate_and_delay_found EQ false> THEN
MOV request_type,set_con_features ;AN000;
MOV eol_found,true ;AN000;
.ELSE
MOV message,OFFSET rate_and_delay_together ;RATE and DELAY must be specified together
MOV noerror,false
.ENDIF
BREAK 15 ;AN000;
.ENDIF
; otherwise:
CALL setup_invalid_parameter ;AN000;
; BREAK
ENDCASE_15:
POP CX
.ENDWHILE ;AN000;
MOV looking_for,eol ;AN000;check for extraneous parms
BREAK 0 ;AN000;CON_keyword
sd_or_dl_or_eol_case:
PUBLIC sd_or_dl_or_eol_case
;have found a screen mode, now may find sd, dl, or eol
CALL parse_parm ;AN000;
; CASE current_parm=
; sd: ;found R or L
.IF <parm_list[current_parm_DI].item_tag EQ L_item_tag> OR ;AN000;
.IF <parm_list[current_parm_DI].item_tag EQ R_item_tag> THEN ;AN000;
MOV looking_for,T_or_EOL ;AN000;request_type already set
BREAK 17 ;AN000;
.ENDIF
; dl:
.IF <parm_list[current_parm_DI].item_tag EQ fourtythree_item_tag> OR ;AN000;
.IF <parm_list[current_parm_DI].item_tag EQ fifty_item_tag> OR ;AN000;
.IF <parm_list[current_parm_DI].item_tag EQ twentyfive_item_tag> THEN ;AN000;
MOV looking_for,eol ;AN000;request_type already set
BREAK 17 ;AN000;
.ENDIF
; eol:
.IF <parser_return_code_AX EQ end_of_command_line> THEN ;AN000;
MOV eol_found,true ;AN000;request_type already set
BREAK 17 ;AN000;
.ENDIF
; otherwise: regardless of what follows must have a parm here, didn't so yell
.IF <parser_return_code_AX EQ operand_missing> THEN ;AN000;two commas with nothing in between
MOV message,OFFSET Invalid_number_of_parameters ;AN000;
MOV noerror,false ;AN000;
.ELSE ;AN000;
CALL setup_invalid_parameter ;AN000;some bogus value or string
.ENDIF ;AN000;
; BREAK
ENDCASE_17:
BREAK 0 ;AN000;sd_or_dl_or_null
sd_or_dl_case:
PUBLIC sd_or_dl_case
;have no first parm, now must find shift direction or screen lines
CALL parse_parm ;AN000;
; CASE current_parm=
; sd:
.IF <parm_list[current_parm_DI].item_tag EQ L_item_tag> OR ;AN000;
.IF <parm_list[current_parm_DI].item_tag EQ R_item_tag> THEN ;AN000;
MOV looking_for,T_or_EOL ;AN000;
MOV request_type,old_video_mode_set ;AN000;
BREAK 18 ;AN000;
.ENDIF
; dl:
.IF <parm_list[current_parm_DI].item_tag EQ fourtythree_item_tag> OR ;AN000;
.IF <parm_list[current_parm_DI].item_tag EQ fifty_item_tag> OR ;AN000;
.IF <parm_list[current_parm_DI].item_tag EQ twentyfive_item_tag> THEN ;AN000;
MOV request_type,old_video_mode_set ;AN000;
MOV looking_for,eol ;AN000;
BREAK 18 ;AN000;
.ENDIF
; eol:
.IF <parser_return_code_AX EQ end_of_command_line> THEN ;AN000;
MOV message,OFFSET invalid_number_of_parameters ;AN000;
MOV noerror,false ;AN000;
MOV eol_found,true ;AN000;
BREAK 18 ;AN000;
.ENDIF
; otherwise:
.IF <parser_return_code_AX EQ operand_missing> THEN ;AN000;two commas with nothing in between
MOV message,OFFSET Invalid_number_of_parameters ;AN000;
MOV noerror,false ;AN000;
.ELSE ;AN000;
CALL setup_invalid_parameter ;AN000;some bogus value or string
.ENDIF ;AN000;
; BREAK
ENDCASE_18:
BREAK 0 ;AN000;sd_or_dl
T_or_EOL_case:
CALL parse_parm ;AN000;
; CASE current_parm=
; T:
.IF <parm_list[current_parm_DI].item_tag EQ T_item_tag> THEN ;AN000;
MOV looking_for,eol ;AN000;request_type already set
BREAK 19 ;AN000;
.ENDIF
; eol:
.IF <parser_return_code_AX EQ end_of_command_line> THEN ;AN000;
MOV eol_found,true ;AN000;request_type already set
BREAK 19 ;AN000;
.ENDIF
; otherwise:
CALL setup_invalid_parameter ;AN000;
; BREAK
ENDCASE_19:
BREAK 0 ;AN000;
device_name_or_eol_case: ;have only /status so far
;The device names are in the parser control blocks
CALL parse_parm
; CASE current_parm=
; COM?:
MOV device_name,OFFSET COM1_str ;AC001;
.IF <parm_list[current_parm_DI].item_tag EQ COM1_item_tag> OR ;AN000;
MOV device_name,OFFSET COM2_str ;AC001;
.IF <parm_list[current_parm_DI].item_tag EQ COM2_item_tag> OR ;AN000;
MOV device_name,OFFSET COM3_str ;AC001;
.IF <parm_list[current_parm_DI].item_tag EQ COM3_item_tag> OR ;AN000;
MOV device_name,OFFSET COM4_str ;AC001;
.IF <parm_list[current_parm_DI].item_tag EQ COM4_item_tag> THEN ;AN000;
MOV looking_for,eol ;AN000;
MOV request_type,com_status ;AN000;
BREAK 20 ;AN000;
.ENDIF
; LPT?,
PRN:
MOV device_name,OFFSET LPT1_str ;AC001;
.IF <parm_list[current_parm_DI].item_tag EQ PRN_item_tag> OR ;AN000;
.IF <parm_list[current_parm_DI].item_tag EQ LPT1_item_tag> OR ;AN000;
MOV device_name,OFFSET LPT2_str ;AC001;
.IF <parm_list[current_parm_DI].item_tag EQ LPT2_item_tag> OR ;AN000;
MOV device_name,OFFSET LPT3_str ;AC001;
.IF <parm_list[current_parm_DI].item_tag EQ LPT3_item_tag> THEN ;AN000;
MOV looking_for,eol ;AN000;
MOV request_type,printer_status ;AN000;
BREAK 20 ;AN000;
.ENDIF
; CON:
.IF <parm_list[current_parm_DI].item_tag EQ CON_item_tag> THEN ;AN000;
MOV looking_for,eol ;AN000;
MOV request_type,all_con_status ;AN000;
BREAK 20 ;AN000;
.ENDIF
; eol:
.IF <parser_return_code_AX EQ end_of_command_line> THEN ;AN000;
MOV request_type,status_for_everything ;AN000;
MOV eol_found,true ;AN000;
BREAK 20 ;AN000;
.ENDIF
; otherwise:
CALL setup_invalid_parameter ;AN000;
; BREAK
ENDCASE_20:
BREAK 0 ;AN000;device_name_or_eol
first_parm_case: ;AN000;
PUBLIC first_parm_case
;set up for calls to system parser
MOV command_line,OFFSET first_char_in_command_line ;AN000;start parser at beginning of the command line
MOV BX,OFFSET parm_lst ;set up parm_list ;AN000;
XOR DI,DI ;AN000;
SUB DI,TYPE parm_list_entry ;AN000;DI is negative, set up for first call to parse_parm
MOV parms.parmsx_ptr,OFFSET parmsx ;AN000;set up parms block for parser input
CALL parse_parm ;AN000;parse first parm, fill in "parm_list[current_parm_DI]" with the results
; CASE current_parm=
dummy5:
PUBLIC dummy5
; /status:
.IF <parm_list[current_parm_DI].keyword_switch_ptr EQ <OFFSET slash_STA>> OR ;AN000;
.IF <parm_list[current_parm_DI].keyword_switch_ptr EQ <OFFSET slash_stat>> OR ;AC004;
.IF <parm_list[current_parm_DI].keyword_switch_ptr EQ <OFFSET slash_STATUS>> THEN ;AN000;
MOV slash_status,deleted ;AN000;make it so /status again is an error
MOV slash_stat,deleted ;AN000;
MOV slash_sta,deleted
MOV looking_for,device_name_or_eol ;AN000;
BREAK 21 ;AN000;
.ENDIF
; null: ;no first parm
.IF <parser_return_code_AX EQ no_error> AND ;AN000;
.IF <parm_list[current_parm_DI].item_tag EQ unspecified> THEN ;AN000;valid null
MOV looking_for,sd_or_dl ;AN000;
MOV parms.parmsx_ptr,OFFSET old_con_parmsx
MOV ordinal,0 ;AN000;start over with new parmsx block
MOV device_name,OFFSET CON_str
MOV request_type,old_video_mode_set ;AN000;
BREAK 21 ;AN000;
.ENDIF
screen_modes: ;first parm is 80, BW80, MONO etc.
PUBLIC screen_modes
.IF <parm_list[current_parm_DI].item_tag GE first_screen_mode_item_tag> AND ;AN000;
.IF <parm_list[current_parm_DI].item_tag LE last_screen_mode_item_tag> THEN ;AN000;
MOV parms.parmsx_ptr,OFFSET old_con_parmsx
MOV ordinal,0 ;AN000;start over with new parmsx block
MOV device_name,OFFSET CON_str
MOV looking_for,sd_or_dl_or_eol ;AN000;
MOV request_type,old_video_mode_set ;AN000;
BREAK 21 ;AN000;
.ENDIF
; LPT?132,
; LPT?80:
MOV device_name,OFFSET LPT1_str ;AN000;assume LPT1
MOV device,"1" ;AC664;set up message
MOV LPTNO,"1" ;see modeprin
MOV parm_list[current_parm_DI+TYPE parm_list_entry].item_tag,onethirtytwo_item_tag ;AN000;save chars/line
.IF <parm_list[current_parm_DI].item_tag EQ LPT1132_item_tag> OR ;AN000;
MOV device_name,OFFSET LPT2_str ;AN000;assume LPT2
MOV LPTNO,"2" ;see modeprin
MOV device,"2" ;AC664;set up message
.IF <parm_list[current_parm_DI].item_tag EQ LPT2132_item_tag> OR ;AN000;
MOV device_name,OFFSET LPT3_str ;AN000;assume LPT3
MOV LPTNO,"3" ;see modeprin
MOV device,"3" ;AC664;set up message
.IF <parm_list[current_parm_DI].item_tag EQ LPT3132_item_tag> OR ;AN000;
MOV device_name,OFFSET LPT1_str ;AN000;assume LPT1
MOV device,"1" ;AC664;set up message
MOV LPTNO,"1" ;see modeprin
MOV parm_list[current_parm_DI+TYPE parm_list_entry].item_tag,eighty_item_tag ;AN000;save chars/line
.IF <parm_list[current_parm_DI].item_tag EQ LPT180_item_tag > OR ;AN000;
MOV device_name,OFFSET LPT2_str ;AN000;assume LPT2
MOV LPTNO,"2" ;see modeprin
MOV device,"2" ;AC664;set up message
.IF <parm_list[current_parm_DI].item_tag EQ LPT280_item_tag > OR ;AN000;
MOV device_name,OFFSET LPT3_str ;AN000;assume LPT3
MOV LPTNO,"3" ;see modeprin
MOV device,"3" ;AC664;set up message
.IF <parm_list[current_parm_DI].item_tag EQ LPT380_item_tag > THEN ;AN000;
ADD DI,TYPE parm_list_entry ;AN000;already have chars per line so skip to next element in list
MOV parms.parmsx_ptr,OFFSET lpt_parmsx ;AN000;
MOV REFRESH_str,deleted ;AN007;no codepage stuff legal
MOV REF_str,deleted ;AN007;
MOV SEL_equal,deleted ;AN007;
MOV SELECT_equal,deleted ;AN007;
MOV PREP_equal,deleted ;AN007;
MOV PREPARE_equal,deleted ;AN007;
MOV ordinal,1 ;AN000;already found chars per line (cl)
MOV looking_for,li_or_null ;AN000;
MOV device_type,LPTX ;AN000;
MOV request_type,old_initialize_printer_port ;AN000;
BREAK 21 ;AN000;
.ELSE ;AN000;clean up after dorking the next parameter
ADD DI,TYPE parm_list_entry ;AN000;point to next entry, the one that needs to be reinitialized
CALL reset_parm_pointer ;AN000;reinitialize the second parm entry, DEC DI
.ENDIF
; LPT1:=,
; LPT1=,
; LPT2:=,
; LPT2=,
; LPT3:=,
; LPT3=:
;have control blocks set up to find COM strings as value of keyword
MOV lptno,0 ;lptno=BIOS digestable printer number for LPT1 set up for modeecho
.IF <parm_list[current_parm_DI].keyword_switch_ptr EQ <OFFSET LPT1_colon_equal>> OR ;AN000;
.IF <parm_list[current_parm_DI].keyword_switch_ptr EQ <OFFSET LPT1_equal>> OR ;AN000;
MOV lptno,1 ;set up for modeecho
.IF <parm_list[current_parm_DI].keyword_switch_ptr EQ <OFFSET LPT2_colon_equal>> OR ;AN000;
.IF <parm_list[current_parm_DI].keyword_switch_ptr EQ <OFFSET LPT2_equal>> OR ;AN000;
MOV lptno,2 ;set up for modeecho
.IF <parm_list[current_parm_DI].keyword_switch_ptr EQ <OFFSET LPT3_colon_equal>> OR ;AN000;
.IF <parm_list[current_parm_DI].keyword_switch_ptr EQ <OFFSET LPT3_equal>> THEN ;AN000;
MOV device,"1" ;set up for call to modeecho
.IF <parm_list[current_parm_DI].item_tag EQ COM1_item_tag> OR ;AN000;
MOV device,"2" ;set up for call to modeecho
.IF <parm_list[current_parm_DI].item_tag EQ COM2_item_tag> OR ;AN000;
MOV device,"3" ;set up for call to modeecho
.IF <parm_list[current_parm_DI].item_tag EQ COM3_item_tag> OR ;AN000;
MOV device,"4" ;set up for call to modeecho
.IF <parm_list[current_parm_DI].item_tag EQ COM4_item_tag> THEN ;AN000;
MOV looking_for,eol ;AN000;
MOV request_type,printer_reroute ;AN000;
MOV reroute_requested,true ;AN000;
MOV device_type,LPTX
BREAK 21 ;AN000;
.ELSE ;AN000;
MOV message,OFFSET com1_or_com2 ;AN000;"Must specify COM1, COM2, COM3 or COM4"
.ENDIF
.ENDIF
; LPTX,: found "LPTX," so chars per line has been skipped
.IF <terminating_delimeter EQ comma> AND NEAR ;AC007;handle other cases later, looking only for "LPTX," now
MOV device_name,OFFSET LPT1_str ;AN000;assume LPT1
MOV device,"1" ;AC664;set up message
MOV LPTNO,"1" ;see modeprin
.IF <parm_list[current_parm_DI].item_tag EQ LPT1_item_tag> OR ;AN000;
MOV device_name,OFFSET LPT2_str ;AN000;assume LPT2
MOV LPTNO,"2" ;see modeprin
MOV device,"2" ;AC664;set up message
.IF <parm_list[current_parm_DI].item_tag EQ LPT2_item_tag> OR ;AN000;
MOV device_name,OFFSET LPT3_str ;AN000;assume LPT3
MOV LPTNO,"3" ;see modeprin
MOV device,"3" ;AC664;set up message
.IF <parm_list[current_parm_DI].item_tag EQ LPT3_item_tag> THEN ;AN000;
MOV parms.parmsx_ptr,OFFSET lpt_parmsx ;AN000;
MOV lines_value_ptr,OFFSET LPT_lines_values ;AN000;
MOV lines_match_flag,simple_string ;AN000;printer lines values are strings
MOV REFRESH_str,deleted ;AN007;no codepage stuff legal
MOV REF_str,deleted ;AN007;
MOV SEL_equal,deleted ;AN007;
MOV SELECT_equal,deleted ;AN007;
MOV PREP_equal,deleted ;AN007;
MOV PREPARE_equal,deleted ;AN007;
MOV ordinal,1 ;AN000;new parmsx, skip chars per line positional
ADD DI,TYPE parm_list_entry ;create entry for skipped chars per line ;AN000;
MOV looking_for,li_or_null ;AN000;
MOV device_type,LPTX ;for rescode
MOV request_type,old_initialize_printer_port ;AN000;
BREAK 21 ;AN000;
.ENDIF
; need to use colon as a delimeter in following cases
modify_parser_control_block seperator_list,addd,colon ;AN000;want to stop on colons
CALL reset_parm_pointer ;reset to first entry in the parm list
MOV ordinal,0 ;start with the first parm again
MOV command_line,OFFSET first_char_in_command_line ;look at first part of command line again
CALL parse_parm ;AN000;parse the first parm again
; COM?:
MOV device_name,OFFSET COM1_str ;AN000;assume COM1
MOV device,"1" ;AN000;set up message
.IF <parm_list[current_parm_DI].item_tag EQ COM1_item_tag> OR ;AN000;
MOV device_name,OFFSET COM2_str ;AN000;assume COM2
MOV device,"2" ;AN000;set up message
.IF <parm_list[current_parm_DI].item_tag EQ COM2_item_tag> OR ;AN000;
MOV device_name,OFFSET COM3_str ;AN000;assume COM3
MOV device,"3" ;AN000;;set up message
.IF <parm_list[current_parm_DI].item_tag EQ COM3_item_tag> OR ;AN000;
MOV device_name,OFFSET COM4_str ;AN000;assume COM4
MOV device,"4" ;AN000;;set up message
.IF <parm_list[current_parm_DI].item_tag EQ COM4_item_tag> THEN ;AN000;
MOV parms.parmsx_ptr,OFFSET com_parmsx ;AN000;
MOV ordinal,0 ;AN000;new parmsx, start with new number of positionals, start at first one
MOV looking_for,com_keyword_or_baud ;AN000;
MOV device_type,COMX ;AN000;;set up for rescode
BREAK 21 ;AN000;
.ENDIF
; LPT?:
MOV device_name,OFFSET LPT1_str ;AN000;assume LPT1
MOV device,"1" ;AC664;set up message
MOV LPTNO,"1" ;see modeprin
.IF <parm_list[current_parm_DI].item_tag EQ LPT1_item_tag> OR ;AN000;
MOV device_name,OFFSET LPT2_str ;AN000;assume LPT2
MOV LPTNO,"2" ;see modeprin
MOV device,"2" ;AC664;set up message
.IF <parm_list[current_parm_DI].item_tag EQ LPT2_item_tag> OR ;AN000;
MOV device_name,OFFSET LPT3_str ;AN000;assume LPT3
MOV LPTNO,"3" ;see modeprin
MOV device,"3" ;AC664;set up message
.IF <parm_list[current_parm_DI].item_tag EQ LPT3_item_tag> THEN ;AN000;
MOV parms.parmsx_ptr,OFFSET lpt_parmsx ;AN000;
MOV columns_value_ptr,OFFSET LPT_columns_values ;AN000;
MOV lines_value_ptr,OFFSET LPT_lines_values ;AN000;
MOV columns_match_flag,simple_string ;AN000;printer columns values are strings
MOV lines_match_flag,simple_string ;AN000;printer lines values are strings
MOV ordinal,0 ;AN000;new parmsx so start over counting positionals
MOV looking_for,prn_kw_status_cp_cl_null ;AN000;
MOV device_type,LPTX ;for rescode
BREAK 21 ;AN000;
.ENDIF
; PRN:
.IF <parm_list[current_parm_DI].item_tag EQ PRN_item_tag> THEN ;AN000;
MOV looking_for,codepage ;AN000;
MOV device_name,OFFSET LPT1_str ;AN000;
BREAK 21 ;AN000;
.ENDIF
; CON:
.IF <parm_list[current_parm_DI].item_tag EQ CON_item_tag> THEN ;AN000;
MOV parms.parmsx_ptr,OFFSET con_parmsx ;AN000;set up for con parms
MOV ordinal,0 ;AN000;start over with new parmsx block
MOV looking_for,BYTE PTR con_kwrd_status_or_cp ;AN000;
MOV device_name,OFFSET CON_str
BREAK 21
.ENDIF
; eol: ;no parms specified
.IF <parser_return_code_AX EQ end_of_command_line> THEN ;AN000;
MOV request_type,status_for_everything ;AN000;
MOV eol_found,true ;AN000;
BREAK 21 ;AN000;
.ENDIF
; COM?baud:
MOV parms.parmsx_ptr, OFFSET mutant_COM_parmsx
;for i in 1 through 4 see if the parm is COMi
MOV match_found,false ;AN000;
MOV i_CL,0 ;AN000;CL:="1"
.WHILE <i_CL LT 4> AND ;AN000;
.WHILE <match_found EQ false> DO ;AN000;
CALL reset_parm_pointer ;AN000;prepare to reparse the parm
INC i_CL ;AN000;use next number as a delimeter
MOV parm_list[current_parm_DI].item_tag,i_CL ;AN000;depends on COM1 thru 4 item tags being 1 thru 4
PUSH CX ;AN000;save the loop counter (the binary form)
ADD i_CL,binary_to_ASCII ;CL=ASCII representation of the index
modify_parser_control_block seperator_list,addd,i_CL ;AN000;make the number (1 to 4)a seperator
MOV ordinal,0 ;AN000;look at first parm each time
MOV command_line,OFFSET first_char_in_command_line ;set parser up at start of the command line each time
PUSH CX ;AN000;save the delimeter (ASCII form)
CALL parse_parm ;AN000;
; .IF <parm_list[current_parm_DI].item_tag EQ COM_item_tag> THEN ;AN000;isloated "COM" so found "COM?"
.IF <parser_return_code_AX EQ no_error> THEN ;AN000;isloated "COM" so found "COMx"
MOV match_found,true ;AN000;
.ENDIF
POP CX ;AN000;restore the ASCII delimeter
modify_parser_control_block seperator_list,delete,i_CL ;AN000;fix parser control blocks
POP CX ;restore the loop counter
.ENDWHILE ;AN000;
.IF <match_found EQ true> THEN ;AN000;IF have COMX THEN look for valid baud
.IF <i_CL EQ 1> THEN ;AN000;
MOV device_name,OFFSET COM1_str ;AN000;
MOV parm_list[current_parm_DI].value1,OFFSET COM1_str ;AN000;setup for modecom existence check
MOV device,"1" ;AN000;set up message
.ELSEIF <i_CL EQ 2> THEN ;AN000;
MOV device_name,OFFSET COM2_str ;AN000;
MOV parm_list[current_parm_DI].value1,OFFSET COM2_str ;AN000;setup for modecom existence check
MOV device,"2" ;AN000;set up message
.ELSEIF <i_CL EQ 3> THEN ;AN000;
MOV device_name,OFFSET COM3_str ;AN000;
MOV parm_list[current_parm_DI].value1,OFFSET COM3_str ;AN000;setup for modecom existence check
MOV device,"3" ;AN000;set up message
.ELSE;IF <i_CL EQ 4> THEN ;AN000;
MOV device_name,OFFSET COM4_str ;AN000;
MOV parm_list[current_parm_DI].value1,OFFSET COM4_str ;AN000;setup for modecom existence check
MOV device,"4" ;AN000;set up message
.ENDIF ;AN000;
MOV parms.parmsx_ptr,OFFSET com_parmsx ;AN000;
MOV ordinal,0 ;AN000;start with baud in new parmsx
MOV looking_for,com_keyword_or_baud ;AN000;
MOV device_type,COMX ;set up for rescode
BREAK 21 ;AN000;
; otherwise: ;first parm was nothing recognizable
.ELSE
dummy4:
PUBLIC dummy4
MOV ordinal,0 ;AN000;parse first parm again
MOV command_line,OFFSET first_char_in_command_line ;set parser up at start of the command line one more time
modify_parser_control_block seperator_list,addd,"." ;AN000;want to stop on periods
modify_parser_control_block seperator_list,addd,'"' ;AN000;want to stop on quotes
modify_parser_control_block seperator_list,addd,'\' ;AN000;want to stop on back slashes
modify_parser_control_block seperator_list,addd,'[' ;AN000;want to stop on left brackets
modify_parser_control_block seperator_list,addd,']' ;AN000;want to stop on right brackets
modify_parser_control_block seperator_list,addd,'+' ;AN000;want to stop on plus signs
;AC003; modify_parser_control_block seperator_list,addd,';' ;AN000;want to stop on semicolons
CALL parse_parm
CALL setup_invalid_parameter ;AN000;
; BREAK
.ENDIF
ENDCASE_21:
BREAK 0 ;AN000;first_parm
eol_case:
CALL parse_parm ;AN000;
.IF <parser_return_code_AX NE end_of_command_line> THEN ;AN000;
MOV message,OFFSET invalid_number_of_parameters ;AN000;
MOV noerror,false ;AN000;
.ELSE NEAR ;AN000;
MOV eol_found,true ;AN000;
.ENDIF
; BREAK
ENDCASE_0: ;AN000;looking_for=
.ENDWHILE ;AN000;
.IF <message NE no_message> THEN
display message
.ENDIF
RET
parse_parameters ENDP
;�������������������������������������������������������������������������������
;�
;� SEPERATOR_LIST
;� --------------
;�
;� As the logic in PARSE_PARAMETERS proceeds the posibilities for the next parm
;� become apparent and the parser control blocks need to be changed to correctly
;� parse the next parm. This procedure is responsible for manipulating the
;� list of seperators as requested.
;�
;�
;�
;�
;� INPUT: action (in BX) - A scalar immediate indicating whether the seperator
;� is to be added or deleted.
;�
;� seperator_charactor (in AL) - The seperator character to be added or
;� deleted from the seperator list
;�
;�
;� RETURN: none
;�
;�
;� MESSAGES: none
;�
;�
;�
;� REGISTER
;� USAGE:
;�
;�
;�
;� CONVENTIONS:
;�
;�
;� ASSUMPTIONS: The character exists in the list before it is deleted.
;� A character being added is not already in the list.
;� There is no "extra end of line list".
;� Direction flag is cleared so REPs will increment index reg
;� ES and DS are the same and address data
;�
;�
;�
;�
;�
;�
;� SIDE EFFECT:
;�
;�
;�
;�
;�
;� LOGIC:
;�
;�
;� CASE action=
;�
;� add:
;�
;� skip to end of seperators list ;use parms.seperators_len to find end
;� overwrite zero with AL
;� overwrite blank space holder in the delimeter list with AL
;� INC parms.seperators_len
;� BREAK
;�
;�
;� delete:
;�
;� DEC parms.seperators_len
;� scan to seperator char to be deleted
;� shift remaining chars to left
;� put zero at end for length of the extra EOL list
;� BREAK
;�
;� ENDCASE
;�
;�
;�������������������������������������������������������������������������������
seperator_list PROC NEAR
;CASE modifier=
SHL BX,1 ;AN000;BX=word displacement into jump table
JMP jump_table2[BX] ;AN000;jump to appropriate jump
jump_table2 LABEL WORD
DW OFFSET add_case ;AN000;
DW OFFSET delete_case ;AN000;
add_case:
XOR BX,BX
MOV BL,parms.seperators_len ;AN000;BX=length of seperators list
ADD BX,OFFSET parms
MOV [BX].seperators,AL ;AN000;overwrite blank with AL
INC parms.seperators_len ;AN000;adjust for added seperator
BREAK 22 ;AN000;
delete_case:
;scan to seperator char to be deleted
PUSH DI
MOV DI,OFFSET parms
ADD DI,OFFSET seperators ;ES:DI=>seperator list
REPNE SCASB
DEC DI ;AN000;DI=>char to be deleted
MOV ES:[DI],BYTE PTR blank ;duplicate but harmless blank
POP DI
BREAK 22 ;AN000;
ENDCASE_22:
RET
seperator_list ENDP
;-------------------------------------------------------------------------------
;�������������������������������������������������������������������������������
;�
;� KEYWORDS
;� --------
;�
;� As the logic in PARSE_PARAMETERS proceeds the posibilities for the next parm
;� become apparent and the parser control blocks need to be changed to correctly
;� parse the next parm. This procedure is responsible for manipulating the
;� list of keywords as requested.
;�
;�
;�
;�
;�# INPUT: action (in BX) - A scalar immediate indicating whether the keyword
;�# is to be added or deleted.
;�#
;�#
;�# string (in RL) - A scalar immediate or OFFSET, indicating/pointing
;�# to the keyword or set of keywords to be added
;�# or deleted.
;�
;�
;�
;� RETURN: none
;�
;�
;� MESSAGES: none
;�
;�
;�
;�
;� REGISTER
;� USAGE:
;�
;�
;�
;� CONVENTIONS:
;�
;�
;�
;�
;� ASSUMPTIONS:
;�
;�
;�
;�
;� SIDE EFFECT:
;�
;�
;�������������������������������������������������������������������������������
keywords PROC NEAR
; use result.synonym to find the the keyword to delete
MOV SI,parm_list[current_parm_DI].keyword_switch_ptr ;SI=>the keyword string to be deleted
MOV BYTE PTR ES:[SI],deleted ;AN000;zilch out first byte of the keyword string
RET
keywords ENDP
;-------------------------------------------------------------------------------
;�������������������������������������������������������������������������������
;�
;� PARSE_PARM
;� ----------
;�
;� Add the parm found to the parm_list. Save the pointer to the current parm
;� for use by CALL reset_parm_pointer. When a reset call from reset_parm
;� happens the pointer to the last entry in the parm list is decremented, which
;� will put the results of the next parse over that entry.
;�
;�
;�
;�
;�
;�
;�
;�
;�
;�
;�
;� INPUT:
;�
;�
;� RETURN: The next parm list entry is filled with the results of the call to
;� the parser. If the parser returns an error other than "end of
;� command line" the entry is not filled in. If the parser returns
;� "end of command line" the .type field is set to end_of_command_line.
;�
;�
;� MESSAGES: none
;�
;�
;�
;�
;�
;�
;�
;�
;�
;�
;�
;� REGISTER
;� USAGE:
;�
;�
;�
;� CONVENTIONS:
;�
;�
;�
;�
;�
;�
;�
;� ASSUMPTIONS:
;�
;�
;�
;�
;�
;�
;�
;�
;� SIDE EFFECT:
;�
;�
;�������������������������������������������������������������������������������
parse_parm PROC
PUBLIC PARSE_PARM
ADD current_parm_DI, TYPE parm_list_entry
PUSH current_parm_DI ;save index into parsed parms list
PUSH BX ;save the address of the parsed parms list
MOV DI,OFFSET PARMS ; ES:DI=>PARSE CONTROL DEFINITON
MOV SI,COMMAND_line ; DS:SI=>unparsed portion of the command line
MOV DX,0 ; RESERVED
MOV CX,ordinal ; OPERAND ORDINAL
EXTRN SYSPARSE:NEAR
CALL SYSPARSE ;AX=return code, DX=>result buffer
MOV ordinal,CX ;save for next call
MOV terminating_delimeter,BL ;save the character that delimited the parm
POP BX ;restore parm_list
POP current_parm_DI ;nothing returned in DI anyway
MOV CX,command_line ;AN000;CX=>first char of the bad parm
MOV offending_parameter_ptr,CX ;AN000;set pointer in message
; .IF <parser_return_code_AX EQ no_error> THEN
MOV command_line,SI ;save pointer to remainder of the command line
.IF <parser_return_code_AX NE end_of_command_line> THEN
MOV DL,result.ret_type
MOV parm_list[current_parm_DI].parm_type,DL
MOV DL,result.item_tag
MOV parm_list[current_parm_DI].item_tag,DL
MOV DX,result.ret_value1
MOV parm_list[current_parm_DI].value1,DX
MOV DX,result.ret_value2
MOV parm_list[current_parm_DI].value2,DX
MOV DX,result.synonym
MOV parm_list[current_parm_DI].keyword_switch_ptr,DX
.ENDIF
; .ELSE ;AN000;encountered an error
; MOV CX,command_line ;AN000;CX=>first char of the bad parm
; MOV offending_parameter_ptr,CX ;AN000;set pointer in message
; MOV BYTE PTR [SI],0 ;AN000;make the offending parm an ASCIIZ string
; .ENDIF ;AN000;leave the call to msg services to the calling routine
RET
parse_parm ENDP
;�������������������������������������������������������������������������������
;�
;� RESET_PARM_POINTER
;� ------------------
;�
;�
;�
;� The last entry in the parm list is decremented, which
;� will put the results of the next parse over that entry.
;�
;�
;�
;�
;�
;�
;�
;�
;�
;�
;�
;� INPUT:
;�
;�
;� RETURN: The current parm list entry is filled with recognizable trash
;�
;�
;�
;�
;� MESSAGES: none
;�
;�
;�
;�
;�
;�
;�
;�
;�
;�
;�
;� REGISTER
;� USAGE:
;�
;�
;�
;� CONVENTIONS:
;�
;�
;�
;�
;�
;�
;�
;� ASSUMPTIONS:
;�
;�
;�
;�
;�
;�
;�
;�
;� SIDE EFFECT:
;�
;�
;�������������������������������������������������������������������������������
;AN000;
reset_parm_pointer PROC
MOV parm_list[current_parm_DI].parm_type,bogus ;AN000;
MOV parm_list[current_parm_DI].item_tag,0FFH ;AN000;
MOV parm_list[current_parm_DI].synonym,bogus ;AN000;
MOV parm_list[current_parm_DI].value1,bogus ;AN000;
MOV parm_list[current_parm_DI].value2,bogus ;AN000;
MOV parm_list[current_parm_DI].keyword_switch_ptr,0 ;AN000;
SUB current_parm_DI,TYPE parm_list_entry ;AN000;
DEC ordinal ;AN000;
RET
reset_parm_pointer ENDP ;AN000;
PRINTF_CODE ENDS ;AN000;
END ;AN000;
|