home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / mskermit / mssdef.h < prev    next >
Text File  |  2020-01-01  |  21KB  |  610 lines

  1. ; File MSSDEF.H
  2. ;    Copyright (C) 1982, 1997, Trustees of Columbia University in the 
  3. ;    City of New York.  The MS-DOS Kermit software may not be, in whole 
  4. ;    or in part, licensed or sold for profit as a software product itself,
  5. ;    nor may it be included in or distributed with commercial products
  6. ;    or otherwise distributed by commercial concerns to their clients 
  7. ;    or customers without written permission of the Office of Kermit 
  8. ;    Development and Distribution, Columbia University.  This copyright 
  9. ;    notice must not be removed, altered, or obscured.
  10.  
  11. ;; MASM v6, use MASM 5.1 constructions (/Zm)    OPTION    M510
  12.     .xlist            ; suppress listing in program
  13.     .sall            ; don't list macro expansions
  14. ; define MS-DOS Kermit conditionals
  15. ; comment out line to re-enable functionality
  16. ;nls_portuguese    equ 1        ; for Portuguese (Brazil) legends
  17. ;no_terminal    equ 1        ; no terminal emulation (no Connect mode)
  18. ;no_graphics    equ 1        ; no Tektronix and no Data General graphics
  19. ;no_network    equ 1        ; no network support at all
  20. ;no_tcp        equ 1        ; no internal TCP/IP stack
  21.  
  22. ifdef    no_network
  23. no_tcp        equ 1        ; tcp is a network channel
  24. endif
  25.  
  26. ifdef    no_terminal        ; implies no graphics
  27. no_graphics    equ 1
  28. endif    ; no_terminal
  29.  
  30. ; Below is for medium-lite (TCP but no terminal emulation)
  31. ;no_terminal    equ 1
  32. ;no_graphics    equ 1
  33.  
  34. ; Note on conditionals: if defining no_graphics then omit file msgibm.asm.
  35. ; if defining no_network or no_tcp then omit files msn*.c, msn*.asm, msn*.h.
  36. ; if defining no_terminal then omit the above plus msuibm.asm and mszibm.asm.
  37.  
  38. version equ    315        ; master version number
  39. verdef    macro
  40.     db    ' MS-DOS Kermit: 3.15'
  41. ifdef    nls_portuguese
  42.     db    ' Portuguese'
  43. endif    ; nls_portuguese
  44.     db    ' 15 Sept 1997'
  45.     endm
  46.  
  47. BELL    EQU    07H
  48. TAB     EQU    09H
  49. LF      EQU    0AH
  50. FF      EQU    0CH
  51. CR      EQU    0DH
  52. XON     EQU    11H
  53. XOFF    EQU    13H
  54. ESCAPE     EQU    1BH
  55. DEL     EQU    7FH
  56. BS      EQU    08H
  57. CTLZ    EQU    1AH
  58. SOH     EQU    01H     ; Start of header char
  59. SPC     EQU    20H
  60. SS2    equ    8eh
  61. SS3    equ    8fh
  62. DCS    equ    90h
  63. CSI    equ    9bh
  64. STCHR    equ    9ch
  65.  
  66. DOS     EQU    21H
  67.  
  68. CONIN    EQU    01H
  69. CONOUT    EQU    02H
  70. LSTOUT    EQU    05H
  71. DCONIO    EQU    06H
  72. CONINQ    EQU    07H    ; quiet console input
  73. PRSTR    EQU    09H
  74. CONSTAT    EQU    0BH
  75. SELDSK    EQU    0EH    ; Select disk
  76. GCURDSK    EQU    19H    ; Current disk
  77. SETDMA    EQU    1AH
  78. SETINTV    EQU    25H    ; Set interrupt vector from ds:dx
  79. GETDATE EQU    2AH    ; Get date
  80. GETTIM    EQU    2CH    ; Get the time of day 
  81. DOSVER    EQU    30H    ; dos version #
  82. GETINTV    EQU    35H    ; get interrupt vector to es:bx
  83. GSWITCH    EQU    37H    ; undocumented get/set switch character
  84. CHDIR    EQU    3BH    ; change directory
  85. CREAT2    EQU    3CH    ; create
  86. OPEN2    EQU    3DH    ; open
  87. CLOSE2    EQU    3EH    ; close
  88. READF2    EQU    3FH    ; read
  89. WRITE2    EQU    40H    ; write
  90. DEL2    EQU    41H    ; delete
  91. LSEEK    EQU    42H    ; lseek
  92. IOCTL    EQU    44H    ; i/o control
  93. GCD    EQU    47H    ; get current directory
  94. ALLOC    EQU    48H    ; allocate memory
  95. FREEMEM    EQU    49H    ; free memory
  96. SETBLK    EQU    4AH    ; modify allocated memory map
  97. EXEC    EQU    4BH    ; execute task
  98. FIRST2    EQU    4EH    ; search for first
  99. NEXT2    EQU    4FH    ; search for next
  100. fileattr equ    57h    ; get/set file's date and time
  101.  
  102. PAREVN    EQU    00    ; Even parity
  103. PARMRK    EQU    01    ; Mark parity
  104. PARNON    EQU    02    ; No parity.    
  105. PARODD    EQU    03    ; Odd parity
  106. PARSPC    EQU    04    ; Space parity
  107. PARHARDWARE EQU    10h    ; indicator of hardware parity
  108. PAREVNH    EQU    PARHARDWARE+PAREVN ; hardware parity (9-bit bytes)
  109. PARMRKH    EQU    PARHARDWARE+PARMRK
  110. PARODDH EQU    PARHARDWARE+PARODD
  111. PARSPCH    EQU    PARHARDWARE+PARSPC
  112.  
  113. FLOXON    EQU    1113H    ; Use XON/XOFF for flow control
  114. FLONON    EQU    0    ; Don't do flow control
  115. DEFHAND    EQU    XON    ; Use XON as default handshake
  116.  
  117. MODCD    EQU    80H    ; MODEM CD handshake line status responses
  118. MODCTS    EQU    10H    ; MODEM CTS
  119. MODDSR    EQU    20H    ; MODEM DSR
  120. MODRI    EQU    40H    ; MODEM RI
  121.  
  122.             ; flags.remflg byte definitions
  123. DQUIET    EQU    1    ; Display mode, suppress file xfer statistics
  124. DREGULAR EQU    2    ; Regular formatted screen display of statistics
  125. DSERIAL    EQU    4    ; Serial mode (non-formatted screen)
  126. D8BIT    EQU    8    ; Display chars as 8-bit vs 7-bit quantities
  127. DSERVER    EQU    10H    ; Server mode active, if this bit is set
  128.  
  129. MAXTAK    EQU    25    ; Max number of TAKE's allowed
  130. DEFMXTRY EQU    5    ; default number of retries on a data packet (63 max)
  131.             ; Init packet gets three times this number of tries
  132.  
  133. DEFESC    EQU    1DH    ; The default escape character (Control rt sq bracket)
  134. DRPSIZ    EQU    94    ; Default receive packet size, regular pkts
  135. DSPSIZ    EQU    94    ; Default send packet size, regular pkts
  136. DSTIME    EQU    8    ; Default send time out interval
  137. DSQUOT    EQU    23H    ; Default send (and receive) quote char
  138. DQBIN    EQU    26H    ; Default 8-bit prefix
  139. DCHKLEN    EQU    1    ; Default checksum length
  140. DEFPAR    EQU    PARNON    ; Default parity (none) 
  141. DEFRPTQ EQU    7EH    ; Default repeat quote
  142.  
  143. bufsiz    equ    1536    ; size of serial port input buffer
  144. buffsz    equ    512    ; size of disk file i/o buffer (buff)
  145. cmdblen    equ    1000    ; length of command lines (sharing buffers)
  146. cptsiz    equ    256    ; size of session capture buffer
  147. tbufsiz    equ    1000    ; size of Take buffers
  148. decbuflen equ    1024    ; length of decode/work buffer
  149. encbuflen equ    512    ; length of encode buffer
  150. maxwind equ    32    ; max number of window slots
  151. macmax    equ    160    ; max number of macros
  152.  
  153.             ; bit defs for flags.capflg (LOG command)
  154. logoff    equ    0    ; Off = no or suspended logging
  155. logdeb    equ    1    ; log debugging (not yet imp)
  156. logpkt    equ    2    ; log packets sent/received
  157. logses    equ    4    ; log connect mode session
  158. logtrn    equ    8    ; log (file) transaction
  159.  
  160.             ; Attributes-allowed bits in flags.attflg 
  161. attchr    equ    1    ; File Character-set
  162. attdate    equ    2    ; File Date/Time
  163. attlen    equ    4    ; File Length
  164. atttype    equ    8    ; File Type
  165. attsys    equ    16    ; System-identification
  166.  
  167. xfr_xparent    equ    0    ; transfer character set indices
  168. xfr_latin1    equ    1    ;  ref table charids in mssfil.asm
  169. xfr_latin2    equ    2
  170. xfr_hebiso    equ    3
  171. xfr_cyrillic    equ    4
  172. xfr_japanese    equ    5
  173.  
  174. lock_disable    equ    0    ; transfer locking shift capability
  175. lock_enable    equ    1
  176. lock_force    equ    2
  177.  
  178. filecol_rename    equ    0    ; File Collision actions for flags.flwflg
  179. filecol_overwrite equ    1    ; match with Rem Set File Collision codes
  180. filecol_backup    equ    2
  181. filecol_append    equ    3
  182. filecol_discard    equ    4
  183. filecol_ask    equ    5
  184. filecol_update    equ    6
  185.  
  186. ; Terminal emulator section
  187.  
  188. ; Kinds of terminals available
  189. ttgenrc equ    0            ; no emulation done by Kermit
  190. ttheath equ    1            ; Heath-19
  191. ttvt52    equ    2            ; VT52
  192. ttvt100    equ    4            ; VT100
  193. ttvt102    equ    8            ; VT102
  194. ttvt220    equ    10h            ; VT220
  195. ttvt320    equ    20h            ; VT320
  196. tttek    equ    40h            ; Tektronix 4010
  197. tthoney    equ    80h            ; Honeywell VIP7809
  198. ttpt200    equ    100h            ; Prime PT200
  199. ttd463    equ    200h            ; Data General D463
  200. ttd470    equ    400h            ; Data General D470
  201. ttwyse    equ    800h            ; Wyse-50
  202. ttd217    equ    1000h            ; Data General D217 (D463 w/217 ident)
  203. ttansi    equ    2000h            ; Ansi.sys flavor (VT100 base)
  204. TTTYPES equ    15            ; Number of terminal types defined
  205.  
  206. ; tekflg bits in byte
  207. tek_active equ    1            ; actively in graphics mode
  208. tek_tek    equ    2            ; Tek terminal
  209. tek_dec    equ    4            ; Tek submode of DEC terminals
  210. tek_sg    equ    8            ; special graphics mode
  211.  
  212. ; DEC emulator status flags (bits in words vtemu.vtflgst and vtemu.vtflgop)
  213. anslnm  equ    1H            ; ANSI line feed/new line mode
  214. decawm  equ    2H            ; DEC autowrap mode
  215. decscnm equ    80H            ; DEC screen mode
  216. decckm  equ    200H            ; DEC cursor keys mode
  217. deckpam equ    400H            ; DEC keypad application mode
  218. decom   equ    800H            ; DEC origin mode
  219. deccol    equ    1000H            ; DEC column mode (0=80 col)
  220. decanm  equ    2000H            ; ANSI mode
  221. ;dececho equ    4000H            ; ANSI local echo on (1 = on)
  222.      
  223. ; Terminal SETUP mode flags (joint with bits above, some name dups)
  224. vsnewline    equ    1H        ; ANSI new line (0 = off)
  225. vswrap        equ    2H        ; Line wrap around (0 = no wrap)
  226. vsnrcm        equ    4H        ; National Rep Char set (0=none)
  227. vswdir        equ    8H        ; Writing direction (0=left, 1 right)
  228. vskeyclick    equ    10H        ; Keyclick (0 = off)
  229. vsmarginbell    equ    20H        ; Margin bell (0 = off)
  230. vscursor    equ    40H        ; Cursor (0 = block, 1 = underline)
  231. vsscreen    equ    80H        ; Screen (0 = normal, 1 = rev. video)
  232. vscntl        equ    100h        ; 8 or 7 bit controls (1 = 8-bit)
  233. vshscroll    equ    4000h        ; horiz scroll (0=auto, 1=manual)
  234. vscompress    equ    8000h        ; compressed text(0=graphics,1=132col)
  235.  
  236. ; VTxxx defaults for SETUP
  237. ; Note: Tab stops default to columns 9, 17, 25, 33, etc
  238. ;
  239. ; VSDEFAULTS holds Kermit startup time settings for the VT100 emulator
  240. ; Configure it by adding together names from the setup mode flags above
  241. ; to turn on features (they default to being off if not mentioned).
  242. ; Set the kind of terminal by placing a ttxxxx name in VTFLGS in the
  243. ; FLGINFO structure well below.
  244.  
  245. vsdefaults    equ    0+vscursor+vshscroll+vscompress    ; default conditions
  246.  
  247. emulst    struc            ; structure for terminal emulator global data
  248. vtflgst    dw    0        ; VTxxx setup flags
  249. vtflgop    dw    0        ; VTxxx runtime flags, like setup flags
  250. vttbs    dw    0        ; pointer to default tab stops 
  251. vttbst    dw    0        ; pointer to tab stops (both in mszibm)
  252. vtchset    db    16        ; value of default character set (16=Latin-1)
  253. vtchop    db    16        ; value of operational char set
  254. att_ptr    dw    0        ; pointer to video attributes: norm, rev
  255. vttable db    4 dup (0ffh)    ; char set number for G0..G3 overrides
  256. vtdnld    db    1        ; autodownload Kermit files (0 = off)
  257. emulst    ends
  258. ; end of terminal emulator section
  259.  
  260. ; Structure definitions
  261.  
  262. ifdef save_mem2            ; define only for Xenix builds
  263. save_mem equ    1        ; for Xenix
  264. endif
  265.  
  266. ifndef save_mem2        ; for regular DOS builds
  267. ; Command parser information
  268. cmdinfo    struc
  269. cmrprs    dd 0        ; offset,segment of where to jmp on reparsing
  270. cmostp  dw 0        ; place to remember stack pointer
  271. cmblen    dw 0        ; length of caller's cmtxt receiving buffer
  272. cmprmp    dw 0        ; address (ds:offset) of prompt
  273. cmwhite    db 0        ; non-zero to permit leading whitespace
  274. cmcr    db 0        ; non-zero to accept bare CR
  275. cmper    db 0        ; non-zero to allow literal backslash-percent in cmd
  276. cmquiet    db 0        ; non-zero for no echoing
  277. cmkeep    db 0        ; non-zero to keep Take/Macro open after EOF
  278. impdo    db 0        ; non-zero for keyword search failure to use DO cmd
  279. cmdirect db 0        ; non-zero to force reading from kbd/file, not Take.
  280. cmdonum    db 0        ; non-zero to allow \number -> byte expansion
  281. cmcomma db 0        ; non-zero to convert comma to space separator
  282. cmcnvkind db 0        ; see cmcnv_* for parser output filter kinds
  283. cmarray    db 0        ; non-zero to allow substitution in array brackets
  284. cmdinfo    ends
  285.  
  286. ; Command parser equates
  287. cmkey    equ    1    ; parse a keyword
  288. cmeol    equ    4    ; parse a CR end of line character
  289. cmline    equ    5    ; parse line of text up to CR
  290. cmword    equ    6    ; parse an arbitrary word
  291. cmcnv_none equ    0    ; CR within curly braces is normal terminator
  292. cmcnv_crprot equ 1    ; allow CR within curly braces
  293.  
  294. endif
  295.  
  296. ; equates for flags.destflg
  297. dest_printer    equ 0
  298. dest_disk    equ 1
  299. dest_screen    equ 2
  300. dest_memory    equ 4
  301.  
  302. ; Flags information
  303. flginfo    struc
  304. belflg    db 1        ; Use bell
  305. comflg    db 1        ; Use COM1 by default
  306. abfflg    db 0        ; Keep incoming file if abort
  307. debug    db 0        ; Debugging mode (default off)
  308. flwflg    db 0        ; File warning (collision) flag (default rename)
  309. extflg    db 0        ; Exit flag (default off)
  310. vtflg    dw ttvt320    ; term emulation type, default
  311. cxzflg    db 0        ; ^X/^Z to interrupt file x-fer
  312. xflg    db 0        ; Seen "X" packet
  313. eoflag    db 0        ; EOF flag; non-zero on EOF
  314. capflg    db 0        ; On if capturing data
  315. takflg    db 0        ; On if echoing commands of TAKE file
  316. timflg    db 1        ; Say if are timing out or not
  317. destflg    db 1        ; Incoming files destination: disk or printer
  318. eofcz    db 0        ; ^Z signals eof if non-zero
  319. remflg    db DREGULAR    ; server (remote) mode plus display flag bits
  320. modflg    db 1        ; non-zero if mode line on
  321. attflg    db 0ffh        ; non-zero if file attributes packets are enabled
  322. chrset    dw 0        ; ident of file character set (437=hardware, CP437)
  323. unkchs    db 0        ; files w/unknown-character-set (0=keep, 1=cancel)
  324. xltkbd    db 1        ; keyboard character-set translation (1=on, 0=off)
  325. oshift    db 0        ; output-shift (1 = auto, 0 = none, default none)
  326. exitwarn db 1        ; exit warning if active session (0 = ignore)
  327. carrier    db 0        ; check Carrier Detect (0 = ignore)
  328. flginfo    ends
  329.  
  330. ifndef save_mem2
  331. ; Transmission parameters
  332. trinfo    struc
  333. maxdat    dw 0        ; Max packet size for send, word for long packets
  334. chklen    db 1        ; Number of characters in checksum
  335. seol      db cr        ; Send EOL char
  336. reol      db cr        ; Receive EOL char
  337. ssoh      db soh        ; Send start-of-packet character
  338. rsoh      db soh        ; Receive start-of-packet character
  339. squote    db dsquot    ; Send quote character
  340. rquote    db dsquot    ; Receive quote character
  341. rptq    db 7eh        ; Repeat quote character (tilde)
  342. rptqenable db 1        ; Repeat quote character enable (1)/disable(0)
  343. spsiz     db dspsiz    ; Send (regular) packet size
  344. rpsiz     db drpsiz    ; Receive (regular) packet size
  345. stime     db dstime    ; Send timeout. (Don't timeout)
  346. rtime     db 5        ; Receive timeout
  347. sdelay    db 0        ; Send delay time (sec) for just SEND command
  348. spad      db 0        ; Send number of padding char
  349. rpad      db 0        ; Receive number of padding char
  350. spadch    db 0        ; Send padding char
  351. rpadch    db 0        ; Receive padding char
  352. ebquot    db 'Y'        ; Send 8-bit quote character
  353. escchr    db defesc    ; Escape character
  354. capas    db 2,0        ; Capas bytes (just two for now)
  355. windo    db 1        ; number of window slots
  356. rlong    dw drpsiz    ; long pkt size we want to receive
  357. slong    dw 9024        ; long pkt size we could send (negotiated with host)
  358. xchset    db 0        ; transfer char set (0=hardware) on comms wire
  359. xchri    db 0        ; transfer char set readable (0) or invertible (1)
  360. xtype    db 0        ; file type for xfer (0=text,1=binary,etc)
  361. sdbl    db 0        ; char to be doubled when sending (if non-null)
  362. rign    db 0        ; char to be ignored when received (if non-null)
  363. lshift    db lock_enable    ; locking shift (0=disable, 1=enable, 2=force on)
  364. cpkind    db 0        ; checkpoint availability
  365. cpint    dd 0        ; checkpoint interval
  366. xmode    db 0        ; binary/manual mode sensing (0=manual)
  367. trinfo    ends
  368. endif
  369.  
  370. ifndef save_mem
  371. pktinfo    struc
  372. datadr    dd 0        ; data field address (segment:offset)
  373. datlen    dw 0        ; length of data field in a packet
  374. datsize    dw 0        ; length of data field buffer
  375. pktype    db 0        ; packet type, a letter
  376. seqnum    db 0        ; packet SEQ number
  377. ackdone    db 0        ; zero if pkt not ack'ed yet
  378. numtry    db 0        ; number of tries on this packet
  379. sndtime dd 0        ; time packet sent, Bios clock ticks
  380. pktinfo    ends
  381. endif
  382.  
  383. filest    struc
  384. dta    db 26 dup(0)    ; DOS, 21 resev'd bytes, file attr, 2 each date & time
  385. sizelo    dw 0        ; DOS, file size double word
  386. sizehi    dw 0
  387. fname    db 13 dup(0)    ; DOS, filename, asciiz, with dot. End of DOS section
  388. handle    dw -1        ; Kermit, file handle
  389. string    db 64 dup(0)    ; Kermit, filename string, including drive and path
  390. fstat    db 0        ; Kermit, status of Find First DOS call
  391. fstat2    db 0        ; zero for disk file, non-zero for device
  392. filest    ends
  393.  
  394. takinfo    struc        ; Take file structure
  395. taktyp    db 0        ; type: valid file, macro, text subsititution
  396. takinvoke db 0        ; taklev of previous DO or top level cmd parser
  397. takhnd    dw 0        ; file handle
  398. takptr    dw 0        ; pointer in buffer to next char to read
  399. takbuf    dw 0        ; segment of Take buffer, must be dd part of takptr
  400. takcnt    dw 0        ; number of unread bytes in buffer
  401. takctr    dw 0        ; COUNT variable for script program control
  402. takargc    dw 0        ; argument quantity count
  403. takper    db 0        ; comand.cmper (\... expansion) while in Take file
  404. takseek dd 0        ; lseek number bytes into disk file for Take Reading
  405. takattr    db 0        ; attributes bitfield
  406. takinfo ends
  407.  
  408. ; values for taktyp field
  409. take_file    equ    1
  410. take_macro    equ    2
  411. take_sub    equ    4
  412. take_comand    equ    8
  413.  
  414. ; values for takattr field
  415. take_malloc    equ    1
  416. take_autocr    equ    2
  417. take_while    equ    8    ; While or For loop or Switch
  418. take_subwhile    equ    16    ; worker from IF part of While/For
  419. ; malloc means new buffer malloc'd and segment is in .takbuf
  420. ; autocr means report out CR at End of File
  421.  
  422. ; Port Information
  423. prtinfo    struc
  424. baud    dw 0        ; Default baud rate
  425. ecoflg    db 0        ; Local echo flag (default off)
  426. parflg    db 0        ; Parity flag (default none)
  427. floflg    db 0        ; If need flow control
  428. hndflg    db 0        ; If need handshake during file transfer
  429. hands    db 0        ; Default handshake
  430. stopbits db 1        ; number of stop bits (1 or 2)
  431. flowc    dw 0        ; Do flow control with XON/XOFF
  432. duplex    db 0        ; Do full (0) or half (1) duplex comms
  433. portrdy db 0        ; Non-zero if comms port is still active
  434. sndproc dw 0        ; byte sending procedure
  435. rcvproc dw 0        ; byte receiving procedure
  436. cloproc dw 0        ; session close procedure
  437. starttime db 4 dup (0)    ; start time hh, mm, ss
  438. prtinfo    ends
  439.  
  440.                 ; ENABLE/DISABLE bits for denyflg
  441. cwdflg    equ    1        ; deny remote cwd
  442. delflg    equ    2        ; deny remote del
  443. dirflg    equ    4        ; deny remote dir
  444. hostflg    equ    8        ; deny remote host
  445. spcflg    equ    10H        ; deny remote space
  446. finflg    equ    20H        ; deny fin, bye, logo to server
  447. getsflg    equ    40H        ; deny paths in get cmds to server
  448. sndflg    equ    80H        ; deny paths in send cmds to server
  449. typflg    equ    100H        ; deny paths in type
  450. pasflg    equ    200h        ; username/password required
  451. kerflg    equ    400h        ; deny remote kermit
  452. prtflg    equ    800h        ; deny remote print
  453. defflg    equ    1000h        ; deny remote define
  454. qryflg    equ    2000h        ; deny remote query
  455. retflg    equ    4000h        ; deny retrieve (file deletion)
  456. tekxflg    equ    8000h        ; deny automatic Tektronix invokation
  457.  
  458. ifndef save_mem
  459. statinfo struc            ; statistics, basic information layout
  460. prbyte    dw    2 dup (0)    ; number of bytes received by port
  461. psbyte    dw    2 dup (0)    ; number of bytes sent to port
  462. frbyte    dw    2 dup (0)    ; bytes received
  463. fsbyte    dw    2 dup (0)    ; bytes sent
  464. prpkt    dw    2 dup (0)    ; number of packets received
  465. pspkt    dw    2 dup (0)    ; number of packets sent
  466. nakrcnt    dw    0        ; count of naks received
  467. nakscnt    dw    0        ; count of naks sent
  468. btime    dw    2 dup (0)    ; start time (seconds) of transfer
  469. etime    dw    2 dup (0)    ; elapsed time (seconds) of transfer
  470. pretry    dw    0        ; packet retries
  471. xstatus    dw    0        ; transfer status
  472. xstatus2 db    0        ; extended (file attribute) status
  473. xname    db    64 dup (0)    ; alias (send/receive as) filename
  474. statinfo ends
  475.  
  476. endif
  477.  
  478. scptinfo struc            ; scripts
  479. inactv    db    0        ; input action value (default proceed)
  480. incasv    db    0        ; input case  (default ignore)
  481. indfto    dw    1        ; input and pause timeout (def 1 sec)
  482. inecho    db    1        ; echo Input cmd text (0 = no)
  483. infilter db    1        ; filer control sequences from screen (0=no)
  484. xmitfill db    0        ; non-zero to TRANSMIT filler for blank line
  485. xmitlf    db    0        ; non-zero to TRANSMIT LF's
  486. xmitpmt    db    lf        ; default prompt for line acknowledgments
  487. xmitpause dw    0        ; millisec pause between lines
  488. scptinfo ends
  489.  
  490. ; definitions for terminal handler:
  491. termarg    struc
  492. flgs    db 0        ; flags
  493. prt    db 0        ; port to use (0,1,etc)
  494. captr    dw 0        ; routine to call with captured data
  495. baudb    db 0        ; baud rate bits
  496. parity    db 0        ; parity
  497. termarg    ends
  498.  
  499. ; Character set identification bytes
  500. C_ASCII        equ    0
  501. C_UKNRC        equ    1
  502. C_DUNRC        equ    2
  503. C_FINRC        equ    3
  504. C_FRNRC        equ    4
  505. C_FCNRC        equ    5
  506. C_DENRC        equ    6
  507. C_ITNRC        equ    7
  508. C_NONRC        equ    8
  509. C_PONRC        equ    9
  510. C_SPNRC        equ    10
  511. C_SENRC        equ    11
  512. C_CHNRC        equ    12
  513. C_DHEBNRC    equ    13
  514. C_ALTROM    equ    14
  515. C_XPARENT    equ    15
  516. C_LATIN1    equ    16
  517. C_DMULTINAT    equ    17
  518. C_DECTECH    equ    18
  519. C_DECSPEC    equ    19
  520. C_DGINT        equ    20
  521. C_DGLINE    equ    21
  522. C_DGWP        equ    22
  523. C_LATIN2    equ    23
  524. C_HEBREWISO    equ    24
  525. C_DECHEBREW    equ    25
  526. C_WYSEGR    equ    26
  527. C_HPROMAN8    equ    27
  528. C_CYRILLIC_ISO    equ    28
  529. C_KOI8        equ    29
  530. C_SHORT_KOI    equ    30
  531. C_JISKAT    equ    141
  532. C_JISROM    equ    142
  533. C_JISKANJI    equ    215
  534.  
  535. ; bits for flag byte
  536. capt    equ 40h        ; capture output
  537. emheath    equ 20h        ; emulate heath
  538. trnctl    equ 08h        ; translate controls (debug)
  539. modoff    equ 04h        ; mode line off
  540. lclecho    equ 01h        ; local echo
  541.  
  542. ; bits for kstatus general Kermit status word
  543. kssuc    equ    0000h    ; success condition
  544. kssend    equ    0001h    ; send file failed
  545. ksrecv    equ    0002h    ; get/receive file failed
  546. ksrem    equ    0004h    ; Remote command failed
  547. kstake    equ    0008h    ; Take file failure
  548. ksgen    equ    0010h    ; general command failure
  549. ksuser    equ    0080h    ; user intervention (aka Control-C)
  550. ksattrib equ    0100h    ; file attributes file rejection
  551.  
  552. emsint    equ    67h            ; EMS interrupt
  553. xmspresent equ    4300h            ; EMS presence check for XMS mgr
  554. emsmgrstat equ    40h            ; EMS get manager status
  555. emsgetseg equ    41h            ; EMS get segment of page frame
  556. emsgetnpgs equ    42h            ; EMS get number free pages
  557. emsalloc equ    43h            ; EMS get handle and allocate memory
  558. emsmapmem equ    44h            ; EMS map memory
  559. emsrelease equ    45h            ; EMS release mapped memory
  560. emsgetver equ    46h            ; EMS get version number
  561. emssetname equ    5301h            ; EMS LIM 4, set name
  562. xmsmanager equ    4310h            ; XMS get manager entry point
  563. xmsquery equ    08h            ; XMS query largest block available
  564. xmsalloc equ    09h            ; XMS allocate memory block
  565. xmsrelease equ    0ah            ; XMS free memory block
  566. xmsmove    equ    0bh            ; XMS move memory block
  567.  
  568. xmsreq struc                ; XMS memory move request block
  569.  xms_count  dd    0            ; bytes to move, must be even
  570.  handle_src dw    0            ; source handle (0 = under 1MB)
  571.  offset_src dd    0            ; offset into source block, bytes
  572.  handle_dst dw    0            ; destination handle
  573.  offset_dst dd    0            ; offset into destination block, bytes
  574. xmsreq    ends
  575.  
  576. mkeyw    macro    key,value    ; widely used data structure
  577.     local    keylen,start
  578. start    equ    $        ; remember start address of structure
  579.     dw    keylen        ; length of "key"
  580.     db    key        ; "key" itself
  581. keylen    equ    $-(start+2)    ; number of bytes in "key"
  582.     dw    value        ; action value
  583.     endm
  584. ;
  585. ; Note well. The following segment references are in THIS file to provide
  586. ; the desired ordering of them in memory. To wit: lowest addresses for
  587. ; 'code', followed by 'data', and only then by 'stack'.
  588. code    segment public 'kcode'
  589. code    ends
  590. code1    segment public 'kcode'
  591. code1    ends
  592. code2    segment public 'kcode'
  593. code2    ends
  594. data    segment public 'kdata'
  595. data    ends
  596. data1    segment public 'kdata'
  597. data1    ends
  598. _TEXT    SEGMENT  WORD PUBLIC 'CODE'
  599. _TEXT    ENDS
  600. _DATA    SEGMENT  WORD PUBLIC 'DATA'
  601. _DATA    ENDS
  602. CONST    SEGMENT  WORD PUBLIC 'CONST'
  603. CONST    ENDS
  604. _BSS    SEGMENT  WORD PUBLIC 'BSS'
  605. _BSS    ENDS
  606. _STACK    SEGMENT    WORD STACK 'STACK'
  607. _STACK    ENDS
  608. DGROUP    GROUP    CONST, _BSS, _DATA, _STACK
  609.     .list
  610.