-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathshowcommand.asm
3628 lines (3453 loc) · 101 KB
/
showcommand.asm
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
name msssho
; File MSSSHO.ASM
include symboldefs.h
; Copyright (C) 1982, 1999, Trustees of Columbia University in the
; City of New York. The MS-DOS Kermit software may not be, in whole
; or in part, licensed or sold for profit as a software product itself,
; nor may it be included in or distributed with commercial products
; or otherwise distributed by commercial concerns to their clients
; or customers without written permission of the Office of Kermit
; Development and Distribution, Columbia University. This copyright
; notice must not be removed, altered, or obscured.
;
; Show & Status commands
; Edit history
; 12 Jan 1995 version 3.14
; Last edit
; 12 Jan 1995
public shorx, shomac, shcom, shfile, shlog, shpro, shscpt, shserv
public shterm, status, statc, stat0, srchkw, srchkww, srchkb, shmem
public destab, seoftab, blktab, dmpname, lsesnam, lpktnam
public ltranam, incstb, inactb, rxoffmsg, rxonmsg, lnout, lnouts
public shosta, begtim, endtim, fsta, ssta ; statistics procedures
public rtmsg, rppos, stpos, rprpos, sppos, perpos, cxerr, frpos
public fmtdsp, ermsg, msgmsg, init, cxmsg, intmsg, kbpr, perpr
public winpr, windflag, pktsize, clrfln, oldkbt, oldper
public wrpmsg, prttab, pasz, shovar, prnname, filekind, filecps
public cntlsho, logtransact, shovarcps, sharray, streampr
public ferbyte, ferdate, ferdisp, fertype, ferchar, fername, ferunk
mcclen equ macmax*10
; equates for screen positioning
ifndef nls_portuguese
scrser equ 0109H ; place for server state display line
scrfln equ 0216H ; place for file name
scrkind equ 0316h ; Place for file kind
scrpath equ 0416h ; Place for current path
scrkb equ 0516H ; Place for Kbytes transferred
scrper equ 0616H ; Place for percentage transferred
scrst equ 0816H ; Place for status
scrnp equ 0a16H ; Place for number of packets
scrsz equ 0b16h ; packet size
scrnrt equ 0c16H ; Place for number of retries
screrr equ 0d16H ; Place for error msgs
scrmsg equ 0e16H ; Last message position
else
scrser equ 0106H ; place for server state display line
scrfln equ 0216H ; place for file name
scrkind equ 0316h ; Place for file kind
scrpath equ 0416h ; Place for current path
scrkb equ 0516H ; Place for Kbytes transferred
scrper equ 061aH ; Place for percentage transferred
scrst equ 081aH ; Place for status
scrnp equ 0a1aH ; Place for number of packets
scrsz equ 0b1ah ; packet size
scrnrt equ 0c1aH ; Place for number of retries
screrr equ 0d1aH ; Place for error msgs
scrmsg equ 0e1aH ; Last message position
endif ; nls_portuguese
scrsp equ 0f00H ; Place for send packet
scrrp equ 1300H ; Place for receive packet
scrrpr equ 1700H ; Prompt when Kermit ends (does cr/lf)
braceop equ 7bh ; opening curly brace
bracecl equ 7dh ; closing curly brace
data segment
extrn termtb:byte, comptab:byte, portval:word,dtrans:byte,rdbuf:byte
extrn trans:byte, curdsk:byte, flags:byte, maxtry:byte, comand:byte
extrn spause:word, taklev:byte, takadr:word, alrhms:byte, bdtab:byte
extrn denyflg:word, rxtable:byte, mcctab:byte, script:byte
extrn errlev:byte, luser:byte, srvtmo:byte, mccptr:word, thsep:byte
extrn scpbuflen:word, setchtab:byte, xfchtab:byte, xftyptab:byte
extrn tfilsz:word, diskio:byte, tloghnd:word, dosnum:word
extrn templp:byte, windused:byte, numpkt:word, verident:byte
extrn decbuf:byte, flotab:byte, warntab:byte, valtab:byte
extrn xfertab1:byte, xfertab2:byte, xfertab3:byte, outpace:word
extrn winusedmax:byte, protlist:byte, takeerror:byte,macroerror:byte
extrn abftab:byte, sndpathflg:byte, marray:word, rcvpathflg:byte
extrn domath_ptr:word, domath_cnt:word, lastfsize:dword
extrn crcword:word, streaming:byte, streamok:byte
crlf db cr,lf,'$'
eqs db ' = $'
spaces db ' $'
outlin1 db 6 dup (' '),'$'
;;; version appears here
ifndef nls_portuguese
outlin2 db cr,lf
db cr,lf,' File name:'
db cr,lf,' File type:'
db cr,lf,' Current path:'
db cr,lf,' KBytes transferred:'
db cr,lf
db cr,lf
db cr,lf,lf
db cr,lf,' Number of packets:'
db cr,lf,' Packet length:'
db cr,lf,' Number of retries: 0'
db cr,lf,' Last error:'
db cr,lf,' Last message:'
db cr,lf,'$'
permsg db cr,' Percent transferred:$'
perscale db ': 0....1....2....3....4....5....6....7....8....9....10$'
lastper db 0
cxzhlp db 'X: cancel file, Z: cancel group, E: exit nicely,'
db ' C: exit abruptly, Enter: retry$'
blanks db 10 dup (' '),'$'
erword db cr,lf,'Error: $'
msword db cr,lf,'Message: $'
rtword db cr,lf,'Retry $'
cxzser db cr,lf,' Type X to cancel file, Z to cancel group,'
db cr,lf,' E to exit nicely, C to quit abruptly,'
db cr,lf,' or Enter to retry',cr,lf,'$'
windmsg db ' Window slots in use:$'
windmsg2 db ' of $'
streammsg db ' Streaming: Active$'
else
outlin2 db cr,lf
db cr,lf,' Nome do arquivo:'
db cr,lf,' Tipo do arquivo:'
db cr,lf,' Percurso atual:'
db cr,lf,' KBytes transferidos:'
db cr,lf
db cr,lf
db cr,lf,lf
db cr,lf,' Quantidade de pacotes:'
db cr,lf,' Tamanho do pacote:'
db cr,lf,' Re-tentativas: 0'
db cr,lf,' Ultimo erro:'
db cr,lf,' Ultima mensagem:'
db cr,lf,'$'
permsg db cr,' Percentagem transferido:$'
perscale db ': 0....1....2....3....4....5....6....7....8....9....10$'
lastper db 0
cxzhlp db 'X: cancela arquivo, Z: cancela grupo, E: encerra elegantemente'
db ' C: encerra abruptamente, Enter: re-tenta$'
blanks db 10 dup (' '),'$'
erword db cr,lf,'Erro: $'
msword db cr,lf,'Messagem: $'
rtword db cr,lf,'Retenta $'
cxzser db cr,lf,' X cancela arquivo, Z cancela grupo,'
db cr,lf,' E cancela elegantemente, C encerra abruptamente,'
db cr,lf,' Enter re-tenta',cr,lf,'$'
windmsg db ' Pacotes por janela:$'
windmsg2 db ' of $'
streammsg db ' Streaming: active$'
endif ; nls_portuguese
windflag db 0 ; flag to init windows msg, 0=none
oldwind db -1 ; last windows in use value
oldper dw 0 ; old percentage
oldkbt dw 0 ; old KB transferred
wrpmsg db 0 ; non-zero if we wrote percent message
fmtdsp db 0 ; non-zero if formatted display in use
prepksz dw 0 ; previous packet size
onehun dw 100
denom dw 0
temp dw 0
temp1 dw 0
shmcnt dw 0
xfercps dd 0
sixteen dw 16
ifndef nls_portuguese
infms1 db 'Server mode: type Control-C to exit',cr,lf,'$'
infms7 db 'File interrupt',cr,lf,'$'
infms8 db 'File group interrupt',cr,lf,'$'
infms9 db 'User ',5eh,' interrupt',cr,lf,'$'
else
infms1 db 'SModo servidor: digte Control-C para encerrar',cr,lf,'$'
infms7 db 'Interrupcao de arquivo',cr,lf,'$'
infms8 db 'Interrupcao de grupo de arquivo',cr,lf,'$'
infms9 db 'Interrompido ',5eh,' pelo usuario',cr,lf,'$'
endif ; nls_portuguese
partab db 9
mkeyw 'none (8-bit data) ',PARNON
mkeyw 'even (7-bit data) ',PAREVN
mkeyw 'odd (7-bit data) ',PARODD
mkeyw 'mark (7-bit data) ',PARMRK
mkeyw 'space (7-bit data) ',PARSPC
mkeyw 'HARDWARE even (9-bit byte)',PAREVNH
mkeyw 'HARDWARE odd (9-bit byte)',PARODDH
mkeyw 'HARDWARE mark (9-bit byte)',PARMRKH
mkeyw 'HARDWARE space (9-bit byte)',PARSPCH
destab db 3
mkeyw 'Disk',dest_disk
mkeyw 'Printer',dest_printer
mkeyw 'Screen',dest_screen
seoftab db 2
mkeyw 'Ctrl-Z',1
mkeyw 'NoCtrl-Z',0
; What type of block check to use
blktab db 4
mkeyw '1-char-checksum',1
mkeyw '2-char-checksum',2
mkeyw '3-char-CRC-CCITT',3
mkeyw 'Blank-free-2','B'-'0'
modtab db 3 ; Mode line status
mkeyw 'off',0
mkeyw 'on',1
mkeyw 'on (owned by host)',2
ontab db 2
mkeyw 'off',0
mkeyw 'on',1
unkctab db 2 ; unknown character-set disposition
mkeyw 'keep',0
mkeyw 'cancel',1
logsta db 8 ; Log Status table
mkeyw 'off',logoff ; suspended or no logging
mkeyw 'Packet',logpkt
mkeyw 'Session',logses
mkeyw 'Packet+Session',logpkt+logses
mkeyw 'Transaction',logtrn
mkeyw 'Packet+Transaction',logpkt+logtrn
mkeyw 'Session+Transaction',logses+logtrn
mkeyw 'Packet+Session+Transaction',logpkt+logses+logtrn
dissta db 6 ; Status of Display mode
mkeyw 'Quiet, 7-bit',dquiet
mkeyw 'Regular, 7-bit',dregular
mkeyw 'Serial, 7-bit',dserial
mkeyw 'Quiet, 8-bit',dquiet+d8bit
mkeyw 'Regular, 8-bit',dregular+d8bit
mkeyw 'Serial, 8-bit',dserial+d8bit
endistab db 2 ; Server ENABLE/DISABLE status
mkeyw 'enabled',0
mkeyw 'disabled',1
inactb db 2 ; Set Input Timeout Action
mkeyw 'Proceed',0 ;[jrs]
mkeyw 'Quit',1 ;[jrs]
incstb db 2 ;[jrs] Set Input Case
mkeyw 'Ignore',0
mkeyw 'Observe',1
pathtab db 3 ; SET SEND/RECEIVE PATHNAMES
mkeyw 'off',0
mkeyw 'relative',1
mkeyw 'absolute',2
; Statistics data storage area
fsta statinfo <> ; for last operation values
ssta statinfo <> ; for session values
sflag db 0 ; flag for send (1) or receive (0)
; 80h = begtim started
statmsg db cr,lf,lf,' Last Transfer '
db ' Entire Session'
db cr,lf,' Item Sent Rec''d '
db ' Sent Rec''d',cr,lf,'$'
fchmsg db cr,lf,' File characters: $'
spmsg db cr,lf,' Comms port chars: $'
pktmsg db cr,lf,' Packets: $'
nakmsg db cr,lf,' NAKs: $'
retmsg db cr,lf,' Packet retries: $'
timemsg db cr,lf,lf,' Protocol time, secs:$'
chpsmsg db cr,lf,' File characters/sec:$'
spedmsg db cr,lf,' Comms port bits/sec:$'
filemsg1 db ' File chars/sec: $'
filemsg2 db ' Efficiency ($'
filemsg3 db ' b/s): $'
sndmsg db 'Sent ',0
rcvmsg db 'Recv ',0
kind_text db 'TEXT$'
kind_binary db 'BINARY$'
date db '00:00:00 00 Jan 1980, ',0
datelen equ $-date-1
atmsg db cr,lf,' at '
atlen equ $-atmsg
fasmsg db ' as '
faslen equ $-fasmsg
fsucmsg db 'completed, ',0
fbadmsg db 'failed, ',0
fintmsg db 'interrupted',0
bytesmsg db 'bytes: ',0
streamstat db ' Streaming used$'
; attributes msgs shared with msssen/mssrcv
ferbyte db 'file_size',0 ; '1' and '!'
ferdate db 'date/time',0 ; '#'
ferdisp db 'file_disposition:',0 ; '+'
fertype db 'file_type',0 ; '"'
ferchar db 'transfer_char-set',0 ; '*'
fername db 'filename_collision',0 ; '?'
ferunk db 'unknown_reason',0 ; other attributes
commamsg db ', '
months db 'JAN','FEB','MAR','APR','MAY','JUN','JUL','AUG','SEP'
db 'OCT','NOV','DEC'
even
tens dd 1,10,100,1000,10000,100000,1000000,10000000,100000000
dd 1000000000
tenslen equ ($-tens) / 4 ; number of double words in array tens
lnoutsep db 0 ; non-zero to separate thousands in lnout
; end statistics data area
sixty dw 60
ten dw 10
logmsg db 'Kind Default filename Status$'
nologmsg db '(not active)$'
lsesmsg db 'Session (Session.log)$'
lpktmsg db 'Packets (Packet.log)$'
ltramsg db 'Transactions (Transact.log)$'
dmpmsg db 'Screen Dump, in Connect mode$'
dmpmsg2 db 'Dump screen: $' ; for general STATUS display
prnmsg db 'Printer name, in Connect mode: $'
modst db 'Mode-line: $'
locst db 'Local echo: $'
duphlf db 'Duplex: half$'
dupful db 'Duplex: full$'
belon db 'Ring bell after transfer$'
beloff db 'No bell after transfer$'
vtemst db 'Terminal type: $' ; terminal emulator
portst db 'Communications port: $'
capmsg db 'Logging: $'
eofmsg db 'EOF mode: $'
flost db 'No flow control used$'
floxmsg db 'Flow control: xon/xoff $'
flost1 db 'Flow control: $'
handst db 'Handshake character: $'
destst db 'Destination: $'
xtypmsg db 'File Type: $'
xchmsg db 'Transfer char-set: $'
xchmsg1 db 'Transfer locking-shift: $'
xchmsg2 db 'Transfer translation: $'
xchmsg3 db 'Transfer mode sensing: $'
xcrcmsg db 'Transfer CRC: $'
chmsg db 'File char set: $'
unkmsg db 'Unknown-char-set: $'
diskst db 'Dir: $'
blokst db 'Block check used: $'
sqcst db 'Send control char prefix: $'
rqcst db 'Receive control char prefix: $'
debon db 'Debug: $'
flwon db 'Collision (file name): $'
parmsg db 'Parity: $'
abfst db 'Incomplete file: $'
repst db 'Repeat count char: $'
rptqena db ' on',0 ; Repeat count enable/disable
rptqdis db ' off',0 ; which much be ASCIIZ
sndmsg1 db 'Send Delay: $'
sndmsg2 db ' sec, Pause: $'
sndmsg3 db ' ms$'
msohst db 'Start-of-Packet char S: ',5eh,'$'
meolst db 'End-of-Packet char S: ',5eh,'$'
msrec db ' R: ',5eh,'$'
msrecv db ' R: $'
tmost db 'Timeout (seconds) S: $'
stimst db 'Send timeout (seconds): $'
rtimst db 'Receive timeout (seconds): $'
spakst db 'Send packet size (maximum): $'
rpakst db 'Receive packet size (maximum): $'
spakst1 db 'Send packet size (current): $'
rpakst1 db 'Receive packet size (current): $'
snpdst db 'Number of padding chars S: $'
spadst db 'Padding char S: ',5eh,'$'
retrymsg db 'Retry send/receive packet limit: $'
swinst db 'Sliding window slots (max): $'
strmmsg db 'Streaming: $'
dispst db 'Display: $'
timmsg db 'Timer: $'
srvmsg db 'Timeout (sec) waiting for a transaction: $'
dblmsg db 'Send double-char: $'
escmes db 'Escape character: $'
exitmes db 'Exit warning: $'
scpmsg db 'Script commands Echo, If, Input, Minput, Output, Pause,'
db ' Reinput,'
db cr,lf,' Transmit, and Wait$'
sechmsg db 'Input echoing: $'
sfiltmsg db 'Filter-echo: $'
scasmsg db 'Case sensitivity: $'
stmo1msg db 'Timeout (seconds): $'
stmo2msg db 'Timeout-action: $'
sxfilmsg db 'Transmit fill-empty-line: $'
sxlfmsg db 'Transmit line-feeds-sent: $'
sxpmtmsg db 'Transmit prompt character: $'
sxpaumsg db 'Transmit pause (millisec): $'
stbufmsg db 'INPUT-buffer-length: $'
stinbmsg db 'INPUT-BUFFER follows:$'
opacemsg db 'Output Pacing (millisec): $'
takecmsg db 'Take echo: $'
takermsg db 'Take error: $'
macermsg db 'Macro error: $'
atton db 'Attributes packets: $'
sachmsg db ' Character-set: $'
sadtmsg db ' Date-Time: $'
salnmsg db ' Length: $'
satymsg db ' Type: $'
baudrt db 'Speed: $'
unrec db 'unknown$'
kbdmsg db 'Keyboard translation: $'
stcntmsg db 'Take/Macro COUNT: $'
stargmsg db 'Take/Macro ARGC: $'
nonemsg db 'not active$'
sterlmsg db 'Errorlevel: $'
stalrmsg db 'Alarm time: $'
lusrmsg db 'Login Username: $'
ssndmsg db 'Send pathnames: $'
srcvmsg db 'Receive pathnames: $'
servmsg db 'Server commands available to remote user: $'
sdefmsg db 'ASSIGN: $'
sbyemsg db 'BYE: $'
scwdmsg db 'CD/CWD: $'
sdelmsg db 'DELETE: $'
sdirmsg db 'DIR: $'
sfinmsg db 'FINISH: $'
sgetmsg db 'GET: $'
shstmsg db 'HOST: $'
skermsg db 'KERMIT: $'
slogmsg db 'LOGIN: $'
smsgmsg db 'MESSAGE:$'
sprtmsg db 'PRINT: $'
sqrymsg db 'QUERY: $'
sretmsg db 'RETRIEVE: $'
sspcmsg db 'SPACE: $'
stypmsg db 'TYPE: $'
stekmsg db 'Term Tek4010 (auto-entry): $'
nonmsg db 'none$'
onmsg db 'on'
offmsg db 'off'
moremsg db cr,lf,'-- More -- press space for more,'
db ' q or Control-C to quit. $'
rxoffmsg db cr,lf,' Input Translation is off$'
rxonmsg db cr,lf,' Input Translation is on$'
shormsg db cr,lf,' Translation table of received byte codes while'
db ' in CONNECT mode -'
db cr,lf,' Format: [received byte (decimal) -> local byte'
db ' (decimal)]',cr,lf,'$'
shopm1 db ' [\$' ; Show Translation material
shopm2 db ' -> \$'
shopm3 db '] $'
shom9m1 db cr,lf,' Free space (bytes) for names: $'
shom9m3 db cr,lf,' No macro(s)$'
memmsg1 db cr,lf,' DOS free memory (bytes):$'
memmsg2 db cr,lf,' Total free bytes: $'
varstng db ' \v($'
cntlmsg1 db cr,lf,lf,' Unprefixed control codes (sent as-is without'
db ' protective prefixing):',cr,lf,' $'
cntlmsg2 db cr,lf,lf,' Prefixed control codes (includes 127, 255, and'
db ' packet start/end):',cr,lf,' $'
prterr db '?Unrecognized value$'
lpktnam db 'Packet.log',54 dup (0) ; default packet log filename
lsesnam db 'Session.log',54 dup (0); default capture/session filename
ltranam db 'Transact.log',52 dup (0); default transaction log filename
dmpname db 'Kermit.scn',54 dup (0) ; file name for screen dumps
prnname db 'PRN',61 dup (0) ; file name for printer
fsharr1 db cr,lf,'Declared arrays:',cr,lf,'$'
fsharr2 db ']',cr,lf,'$'
even
stent struc ; structure for status information table sttab
sttyp dw ? ; type (actually routine to call)
msg dw ? ; message to print
val2 dw ? ; needed value: another message, or tbl addr
tstcel dw ? ; address of cell to test, in data segment
basval dw 0 ; base value, if non-zero
stent ends
sttab stent <baudprt> ; STATUS
stent <srchkww,vtemst,termtb,flags.vtflg> ; terminal emulator
stent <srchkw,portst,comptab,flags.comflg>
stent <srchkw,modst,modtab,flags.modflg>
stent <srchkw,parmsg,partab,parflg,portval>
stent <stlnum,spakst,,dtrans.slong>
stent <onoff,locst,,ecoflg,portval>
stent <stlnum,rpakst,,dtrans.rlong>
stent <srchkw,flost1,flotab,floflg,portval>
stent <prsar,msohst,msrec,trans.ssoh,trans.rsoh>
stent <prhnd>
stent <prsar,meolst,msrec,trans.seol,trans.reol>
stent <msg2,dupful,duphlf,duplex,portval>
stent <prsarv,tmost,msrecv,dtrans.stime,trans.rtime>
stent <drnum,diskst,,curdsk>
stent <stnum,retrymsg,,maxtry>
stent <srchkw,flwon,warntab,flags.flwflg>
stent <srchkw,blokst,blktab,dtrans.chklen>
stent <srchkw,destst,destab,flags.destflg>
stent <srchkw,capmsg,logsta,flags.capflg>
stent <srchkw,abfst,abftab,flags.abfflg>
stent <srchkw,debon,logsta,flags.debug>
stent <srchkw,dispst,dissta,flags.remflg>
stent <onoff,timmsg,,flags.timflg>
stent <onechr,escmes,,trans.escchr>
stent <srchkw,kbdmsg,ontab,flags.xltkbd>
;;; stent <vtstat>
dw 0 ; end of table
stcom stent <srchkw,portst,comptab,flags.comflg> ; SHOW COMMS
stent <baudprt>
stent <onoff,locst,,ecoflg,portval>
stent <srchkw,parmsg,partab,parflg,portval>
stent <prhnd>
stent <srchkw,flost1,flotab,floflg,portval>
stent <msg2,dupful,duphlf,duplex,portval>
stent <srchkw,dispst,dissta,flags.remflg>
stent <srchkw,debon,logsta,flags.debug>
stent <srchkw,exitmes,ontab,flags.exitwarn>
dw 0
stfile stent <drnum,diskst,,curdsk> ; SHOW FILE
stent <srchkw,abfst,abftab,flags.abfflg>
stent <srchkw,destst,destab,flags.destflg>
stent <srchkw,flwon,warntab,flags.flwflg>
stent <srchkw,eofmsg,seoftab,flags.eofcz>
stent <srchkww,chmsg,setchtab,flags.chrset>
stent <srchkw,xtypmsg,xftyptab,dtrans.xtype>
stent <srchkw,xchmsg,xfchtab,dtrans.xchset>
stent <msg2,beloff,belon,flags.belflg>
stent <srchkw,xchmsg2,xfertab2,dtrans.xchri>
stent <stmsg,atton>
stent <srchkw,xchmsg1,xfertab1,dtrans.lshift>
stent <srchkb,sachmsg,ontab,attchr,flags.attflg>
stent <srchkw,unkmsg,unkctab,flags.unkchs>
stent <srchkb,sadtmsg,ontab,attdate,flags.attflg>
stent <stmsg,spaces>
stent <srchkb,salnmsg,ontab,attlen,flags.attflg>
stent <stmsg,spaces>
stent <srchkb,satymsg,ontab,atttype,flags.attflg>
dw 0
stlog stent <stmsg,logmsg> ; SHOW LOG
stent <stmsg,lpktmsg>
stent <msg2b,nologmsg,lpktnam,logpkt,flags.capflg>
stent <stmsg,lsesmsg>
stent <msg2b,nologmsg,lsesnam,logses,flags.capflg>
stent <stmsg,ltramsg>
stent <msg2b,nologmsg,ltranam,logtrn,flags.capflg>
stent <stmsg,dmpmsg>
stent <stmsg,dmpname>
stent <stmsg,prnmsg>
stent <stmsg,prnname>
dw 0
stpro stent <stlnum,spakst,,dtrans.slong> ; SHOW PROTOCOL
stent <stlnum,rpakst,,dtrans.rlong>
stent <stlnum,spakst1,,trans.slong>
stent <stlnum,rpakst1,,trans.rlong>
stent <stnum,stimst,,dtrans.stime>
stent <stnum,rtimst,,trans.rtime>
stent <onechr,sqcst,,dtrans.squote>
stent <onechr,rqcst,,trans.rquote>
stent <srchkw,ssndmsg,pathtab,sndpathflg>
stent <srchkw,srcvmsg,pathtab,rcvpathflg>
stent <prsar,msohst,msrec,trans.ssoh,trans.rsoh>
stent <prsarv,snpdst,msrecv,dtrans.spad,trans.rpad>
stent <prsar,meolst,msrec,trans.seol,trans.reol>
stent <prsar,spadst,msrec,dtrans.spadch,trans.rpadch>
stent <onechr,dblmsg,,dtrans.sdbl>
stent <rptstat,repst>
stent <prsnd,sndmsg1>
stent <srchkw,blokst,blktab,dtrans.chklen>
stent <stnum,retrymsg,,maxtry>
stent <stnum,swinst,,dtrans.windo>
stent <prhnd>
stent <srchkw,strmmsg,ontab,streaming>
stent <onoff,timmsg,,flags.timflg>
stent <srchkw,xtypmsg,xftyptab,dtrans.xtype>
stent <srchkw,capmsg,logsta,flags.capflg>
stent <srchkw,xtypmsg,xftyptab,dtrans.xtype>
stent <srchkw,debon,logsta,flags.debug>
stent <srchkww,chmsg,setchtab,flags.chrset>
stent <stmsg,atton>
stent <srchkw,xchmsg,xfchtab,dtrans.xchset>
stent <srchkb,sachmsg,ontab,attchr,flags.attflg>
stent <srchkw,xchmsg2,xfertab2,dtrans.xchri>
stent <srchkb,sadtmsg,ontab,attdate,flags.attflg>
stent <srchkw,xchmsg1,xfertab1,dtrans.lshift>
stent <srchkb,salnmsg,ontab,attlen,flags.attflg>
stent <srchkw,xchmsg3,xfertab3,dtrans.xmode>
stent <srchkb,satymsg,ontab,atttype,flags.attflg>
stent <srchkw,xcrcmsg,ontab,dtrans.xcrc>
dw 0
stscpt stent <stmsg,scpmsg> ; SHOW SCRIPT
stent <onoff,sechmsg,,script.inecho>
stent <srchkw,scasmsg,incstb,script.incasv>
stent <onoff,sfiltmsg,,script.infilter>
stent <stalr,stalrmsg>
stent <srchkw,stmo2msg,inactb,script.inactv>
stent <stlnum,stmo1msg,,script.indfto>
stent <prfil>
stent <starg,stargmsg>
stent <onoff,sxlfmsg,,script.xmitlf>
stent <stcnt,stcntmsg>
stent <stlnum,sxpaumsg,,script.xmitpause>
stent <srchkw,takecmsg,ontab,flags.takflg>
stent <onechr,sxpmtmsg,,script.xmitpmt>
stent <srchkw,takermsg,ontab,takeerror>
stent <stlnum,opacemsg,,outpace>
stent <srchkw,macermsg,ontab,macroerror>
stent <stlnum,stbufmsg,,scpbuflen>
stent <stnum,sterlmsg,,errlev>
stent <stmsg,stinbmsg>
stent <stinbuf>
dw 0
stserv stent <pasz,lusrmsg,offset luser> ; SHOW SERVER
stent <stmsg,servmsg>
stent <srchkb,sdefmsg,endistab,defflg,denyflg>
stent <srchkb,skermsg,endistab,kerflg,denyflg>
stent <srchkb,sbyemsg,endistab,byeflg,denyflg>
stent <srchkb,slogmsg,endistab,pasflg,denyflg>
stent <srchkb,scwdmsg,endistab,cwdflg,denyflg>
stent <srchkb,smsgmsg,endistab,sndflg,denyflg>
stent <srchkb,sdelmsg,endistab,delflg,denyflg>
stent <srchkb,sprtmsg,endistab,prtflg,denyflg>
stent <srchkb,sdirmsg,endistab,dirflg,denyflg>
stent <srchkb,sqrymsg,endistab,qryflg,denyflg>
stent <srchkb,sfinmsg,endistab,finflg,denyflg>
stent <srchkb,sretmsg,endistab,retflg,denyflg>
stent <srchkb,sgetmsg,endistab,getsflg,denyflg>
;; OLD stent <srchkb,sspcmsg,endistab,spcflg,denyflg>
stent <srchkb,stypmsg,endistab,typflg,denyflg>
stent <srchkb,shstmsg,endistab,hostflg,denyflg>
dw 0
stserv2 stent <stnum,srvmsg,,srvtmo>
dw 0
ifndef no_terminal
stterm stent <srchkww,vtemst,termtb,flags.vtflg> ; SHOW TERMINAL
stent <srchkw,dispst,dissta,flags.remflg>
stent <srchkw,modst,modtab,flags.modflg>
stent <onechr,escmes,,trans.escchr>
ifndef no_graphics
stent <srchkb,stekmsg,endistab,tekxflg,denyflg>
endif ; no_graphics
stent <srchkw,kbdmsg,ontab,flags.xltkbd>
stent <vtstat>
dw 0
endif ; no_terminal
shorxk stent <srchkw,kbdmsg,ontab,flags.xltkbd>
stent <stmsg,spaces>
dw 0
data ends
data1 segment
shmmsg db ' name of macro, or press ENTER to see all$'
shvmsg db ' name of \v(name) variable, or press ENTER to see all$'
data1 ends
code1 segment
extrn fwrtdir:far, fcsrtype:far, prtscr:far, strlen:far
extrn prtasz:far, dec2di:far, domath:far, decout:far
extrn buflog:far
code1 ends
code segment
extrn comnd:near, locate:near
extrn getbaud:near, vtstat:near, shomodem:near, nvaltoa:near
extrn cmblnk:near, putmod:near, clrmod:near
extrn poscur:near, clearl:near, nout:near, dodec:near
ifndef no_network
extrn shownet:near
endif ; no_network
assume cs:code, ds:data, es:nothing
flnout proc far
call lnout
ret
flnout endp
flnouts proc far
call lnouts
ret
flnouts endp
fnvaltoa proc far
call nvaltoa
ret
fnvaltoa endp
fclearl proc far
call clearl
ret
fclearl endp
fposcur proc far
call poscur
ret
fposcur endp
; Display asciiz message pointed to by DS:DX on Last error line
ERMSG PROC NEAR
test flags.remflg,dquiet ; quiet screen?
jnz ermsgx ; nz = yes
push si ; position cursor to Last Error line
push dx ; save preexisting message pointer
test flags.remflg,dserial ; serial mode display?
jnz erpo1 ; nz = yes
cmp fmtdsp,0 ; formatted display?
jne erpo2 ; ne = yes
erpo1: mov ah,prstr
mov dx,offset erword ; put out word Error:
int dos
jmp short erpo3
erpo2: mov dx,screrr
call poscur
call clearl ; clear the line
erpo3: pop dx ; restore old pointer
mov si,dx ; string pointer
mov cx,10 ; try ten items
cld
ermsg1: lodsb
cmp al,' ' ; strip these leading spaces
loope ermsg1
dec si ; backup to non-space
push dx ; preserve caller's dx
mov dx,si
call prtasz ; display asciiz message
pop dx
pop si
ermsgx: ret
ERMSG ENDP
; Decode and display Message packet pointed to by SI.
MSGMSG PROC NEAR
mov decbuf,0 ; clear output buffer for rem query
call dodec ; decode to decbuf, SI is pktinfo ptr
test flags.remflg,dquiet ; quiet screen?
jnz msgmsgx ; nz = yes
cmp [si].datlen,0 ; anything present?
je msgmsgx ; e = no
test flags.remflg,dserial ; serial mode display?
jnz msgms1 ; nz = yes
cmp fmtdsp,0 ; formatted display?
jne msgms2 ; ne = yes
cmp flags.xflg,0 ; packet header seen?
je msgms2 ; e = no
msgms1: mov ah,prstr
mov dx,offset msword ; put out word Message:
int dos
jmp short msgms3 ; display the message
msgms2: push si
mov dx,scrmsg ; Last message line
call poscur
call clearl ; clear the line
pop si
msgms3: mov dx,offset decbuf ; final error message string, asciiz
call prtasz ; display asciiz message
msgmsgx:ret
MSGMSG ENDP
; Show number of retries message
RTMSG PROC NEAR
test flags.remflg,dquiet ; quiet display mode?
jnz rtmsx ; nz = yes
test flags.remflg,dserver ; in server mode?
jnz rtms0 ; nz = yes
cmp flags.xflg,0 ; receiving to screen?
jne rtmsx ; ne = yes
cmp fmtdsp,0 ; formatted display?
je rtms1 ; e = no, do as normal
rtms0: test flags.remflg,dserial ; serial mode display?
jnz rtms1 ; nz = yes
push ax
push dx
push si
mov dx,scrnrt
call poscur
call clearl
pop si
jmp short rtms3
rtms1: push ax
push dx
mov dx,offset rtword ; display word Retry
mov ah,prstr
int dos
rtms3: mov ax,fsta.pretry ; number of retries
call decout ; write the number of group retries
pop dx
pop ax
rtmsx: ret
RTMSG ENDP
; Reassure user that we acknowledge his ^X/^Z
INTMSG PROC NEAR
cmp flags.cxzflg,0 ; anything there?
je int1 ; e = no
test flags.remflg,dserver ; server mode?
jnz int4 ; nz = yes
cmp flags.xflg,0 ; writing to screen?
jne int1 ; ne = yes, nothing to do
int4: test flags.remflg,dquiet ; quiet screen?
jnz int1 ; yes, suppress msg
test flags.remflg,dserial ; serial mode display?
jz int2 ; z = no
cmp fmtdsp,0 ; formatted screen?
jne int2 ; ne = yes
mov dx,offset crlf ; output initial cr/lf
mov ah,prstr
int dos
jmp short int3 ; display the message
int2: mov dx,scrmsg ; last message position
call poscur
call clearl
int3: mov dx,offset infms7 ; File interrupted
cmp flags.cxzflg,'X' ; File interrupt?
je int0 ; e = yes
mov dx,offset infms8 ; File group interrupted
cmp flags.cxzflg,'Z' ; correct?
je int0 ; e = yes
mov dl,flags.cxzflg ; say Control ^letter interrupt
mov infms9+6,dl ; store interrupt code letter
mov dx,offset infms9
int0: mov ah,prstr
int dos
int1: ret
INTMSG ENDP
; Clear Last error and Last message lines
cxerr: mov temp,0 ; say last error line
jmp short cxcomm ; do common code
CXMSG PROC NEAR
mov temp,1 ; say last message line
cxcomm: test flags.remflg,dserver ; server mode?
jnz cxm1 ; nz = yes
cmp flags.xflg,0 ; Writing to screen?
jne cxm0 ; ne = yes
cxm1: cmp fmtdsp,0 ; formatted display?
je cxm0 ; e = no
push dx
push si
mov dx,screrr ; Last Error postion
cmp temp,0 ; do last error line?
je cxm2 ; e = yes
mov dx,scrmsg ; Last Message position
cxm2: call poscur
call clearl
pop si
pop dx
cxm0: ret
CXMSG ENDP
; Clear out the old filename on the screen.
CLRFLN PROC FAR
test flags.remflg,dquiet ; quiet display?
jnz clrflnx ; nz = yes
test flags.remflg,dserial ; serial display mode?
jnz clrfln1 ; nz = yes, use just cr/lf
cmp fmtdsp,0 ; formatted display?
je clrfln1 ; e = no
mov dx,scrfln
call poscur
call clearl ; clear to end of line
ret
clrfln1:push ax ; for serial display, does cr/lf
mov ah,prstr
mov dx,offset crlf
int dos
pop ax
clrflnx:ret
CLRFLN ENDP
; display packet quantity and size, SI has pkt ptr
PKTSIZE PROC NEAR
push ax
push dx
push si
cmp fmtdsp,0 ; formatted display?
je pktsiz2 ; e = no, no display
mov ax,[si].datlen ; packet size (data part)
cmp trans.chklen,'B'-'0' ; this special case?
jne pktsiz4 ; ne = no
add al,2 ; special case is two byte chksum
jmp short pktsiz5
pktsiz4:add al,trans.chklen ; plus checksum
pktsiz5:adc ah,0
cmp ax,prepksz ; same as previous packet?
je pktsiz2 ; e = yes, skip display of size
push ax
mov dx,scrsz ; position cursor
call poscur
pop ax
mov prepksz,ax ; remember new value
add ax,2 ; plus SEQ, TYPE
cmp ax,94 ; larger than Regular?
jbe pktsiz1 ; be = no
add ax,3 ; add Long Packet len and chksum
pktsiz1:call decout ; show packet length
mov ah,prstr
mov dx,offset blanks ; spaces to clear old material
int dos
; number of packets part
pktsiz2:test flags.remflg,dquiet ; quiet screen?
jnz pktsiz3 ; nz = yes
call nppos ; number of packets sent
mov ax,numpkt ; number of packets
call nout ; write the packet number
pktsiz3:pop si
pop dx
pop ax
ret
PKTSIZE ENDP
; some random screen positioning functions, all near callable only
kbpos: mov dx,scrkb ; KBytes transferred
cmp fmtdsp,0 ; formatted display?
jne setup2 ; ne = yes
ret ; else ignore postioning request
perpos: mov dx,scrper ; Percent transferred
cmp fmtdsp,0 ; formatted display?
jne setup2 ; ne = yes
ret ; else ignore postioning request
frpos: mov dx,scrmsg ; say renamed file
jmp short setup2
stpos: mov dx,scrst ; status of file transfer
jmp short setup2
nppos: mov dx,scrnp ; Number of packets sent
cmp fmtdsp,0 ; formatted display?
jne setup2 ; ne = yes
ret
rprpos: test flags.remflg,dserial+dquiet ; reprompt position
jnz rprpos1 ; nz = no mode line for these
cmp fmtdsp,0 ; formatted display?
je rprpos1 ; e = no, so no mode line
call clrmod ; clear mode line
rprpos1:mov dx,scrrpr ; Reprompt position
call setup2 ; position cursor
mov fmtdsp,0 ; turn off formatted display flag
ret
sppos: mov dx,scrsp ; Debug Send packet location
jmp short setup1
rppos: mov dx,scrrp ; Debug Receive packet location
jmp short setup1
; common service routines for positioning
setup1: test flags.remflg,dquiet+dserial; quiet or serial display mode?
jnz setupa ; nz = yes
cmp fmtdsp,0 ; non-formatted display?
je setupa ; e = yes
call poscur
ret
setup2: test flags.remflg,dquiet+dserial; quiet or serial display mode?
jnz setupa ; nz = yes
cmp fmtdsp,0 ; non-formatted display?
je setupa ; e = yes
call poscur ; no
call clearl
ret
setupa: test flags.remflg,dquiet ; quiet mode?
jnz setupx ; nz = yes, do nothing
push ax ; display cr/lf and return
push dx
mov dx,offset crlf
mov ah,prstr
int dos
pop dx
pop ax
setupx: ret
; Initialize formatted screen
INIT PROC NEAR
mov windflag,0 ; init windows in use display flag
test flags.remflg,dquiet ; quiet display mode?
jnz init4 ; nz = yes
test flags.remflg,dserver ; server mode?
jnz init1 ; nz = yes
cmp flags.xflg,0 ; destination is screen
jne init4 ; ne = yes
init1: test flags.remflg,dserial ; serial mode display?
jnz init3 ; nz = yes
xor al,al ; cursor off code is zero
call fcsrtype ; turn off PC cursor (IBM-PC dep)
call cmblnk ; clear the screen
mov dx,offset cxzhlp
call putmod ; write mode line
mov fmtdsp,1 ; say doing formatted display
test flags.remflg,dserver ; server mode?
jz init2 ; z = no
mov dx,scrser ; move cursor to top of screen
call poscur
mov ah,prstr
mov dx,offset infms1 ; say now in server mode
int dos
init2: call locate
mov ah,prstr ; put statistics headers on the screen
mov dx,offset outlin1
int dos
mov dx,offset verident
int dos