home *** CD-ROM | disk | FTP | other *** search
/ Phoenix CD 2.0 / Phoenix_CD.cdr / 01e / msk230s1.zip / MSSDEF.H < prev    next >
Text File  |  1988-02-12  |  17KB  |  395 lines

  1. ; File MSSDEF.H
  2.         .xlist                  ; suppress listing in program
  3.         .sall                   ; don't list macro expansions
  4. verdef  macro
  5.         db      ' Kermit-MS: V2.30  8 Jan 1988'
  6.         endm
  7.  
  8. BELL    EQU     07H
  9. TAB     EQU     09H
  10. LF      EQU     0AH
  11. FF      EQU     0CH
  12. CR      EQU     0DH
  13. XON     EQU     11H
  14. XOFF    EQU     13H
  15. ESCAPE  EQU     1BH
  16. DEL     EQU     7FH
  17. BS      EQU     08H
  18. CTLZ    EQU     1AH
  19. SOH     EQU     01H     ; Start of header char.
  20. SPC     EQU     20H
  21.  
  22. DOS     EQU     21H
  23.  
  24. CONIN   EQU     01H
  25. CONOUT  EQU     02H
  26. RDRIN   EQU     03H
  27. PUNOUT  EQU     04H
  28. LSTOUT  EQU     05H
  29. DCONIO  EQU     06H
  30. CONINQ  EQU     07H     ; quiet console input
  31. PRSTR   EQU     09H
  32. CONSTAT EQU     0BH
  33. SELDSK  EQU     0EH     ; Select disk.
  34. GCURDSK EQU     19H     ; Current disk.
  35. SETDMA  EQU     1AH
  36. GETTIM  EQU     2CH     ; Get the time of day.
  37. DOSVER  EQU     30H     ; dos version #
  38. GSWITCH EQU     37H     ; undocumented get/set switch character
  39. CHDIR   EQU     3BH     ; change directory
  40. CREAT2  EQU     3CH     ; 2.0 create [jrd]
  41. OPEN2   EQU     3DH     ; 2.0 open
  42. CLOSE2  EQU     3EH     ; 2.0 close
  43. READF2  EQU     3FH     ; 2.0 read.
  44. WRITE2  EQU     40H     ; 2.0 write
  45. DEL2    EQU     41H     ; 2.0 delete
  46. LSEEK   EQU     42H     ; 2.0 lseek
  47. CHMOD2  EQU     43H     ; 2.0 chmod
  48. IOCTL   EQU     44H
  49. GCD     EQU     47H     ; 2.0 get current directory.
  50. ALLOC   EQU     48H     ; allocate memory
  51. FREEMEM EQU     49H     ; free memory
  52. SETBLK  EQU     4AH     ; modify allocated memory map
  53. EXEC    EQU     4BH     ; 2.0 execute task
  54. FIRST2  EQU     4EH     ; 2.0 search for first
  55. NEXT2   EQU     4FH     ; 2.0 search for next
  56.  
  57.  
  58. PAREVN  EQU     00      ; Even parity.
  59. PARMRK  EQU     01      ; Mark parity.
  60. PARNON  EQU     02      ; No parity.
  61. PARODD  EQU     03      ; Odd parity.
  62. PARSPC  EQU     04      ; Space parity.
  63.  
  64. CMKEY   EQU     01      ; Parse a keyword.
  65. CMCFM   EQU     04      ; Parse a confirm.
  66. CMTXT   EQU     05      ; Parse arbitrary text up to CR.
  67. CMFILE  EQU     06      ; parse string surrounded by whitespace. [jrd]
  68.  
  69. FLOXON  EQU     1113H   ; Use XON/XOFF for flow control.
  70. FLONON  EQU     0       ; Don't do flow control.
  71. DEFHAND EQU     XON     ; Use XON as default handshake.
  72.  
  73.                         ; flags.remflg byte definitions.
  74. DQUIET  EQU     1       ; Display mode, suppress file xfer statistics
  75. DREGULAR EQU    2       ; Regular formatted screen display of statistics
  76. DSERIAL EQU     4       ; Serial mode (non-formatted screen)
  77. D8BIT   EQU     8       ; Display chars as 8-bit vs 7-bit quantities
  78. DSERVER EQU     10H     ; Server mode active, if this bit is set
  79.  
  80. MAXTAK  EQU     5       ; Max number of TAKE's allowed.
  81. DEFMXTRY EQU    5       ; default number of retries on a data packet (63 max).
  82.                         ; Init packet gets three times this number of tries.
  83.  
  84. DEFESC  EQU     1DH     ; The default escape character (Control rt sq bracket)
  85. DRPSIZ  EQU     94      ; Default receive packet size, regular pkts.
  86. DSPSIZ  EQU     94      ; Default send packet size, regular pkts.
  87. DSTIME  EQU     08      ; Default send time out interval.
  88. DRTIME  EQU     13      ; Default receive time out interval.
  89. DSRVTM  EQU     30      ; Default server timeout.
  90. DSPAD   EQU     0       ; Default send padding.
  91. DRPAD   EQU     0       ; Default receive padding.
  92. DSPADC  EQU     0       ; Default send padding char.
  93. DRPADC  EQU     0       ; Default receive padding char.
  94. DSEOL   EQU     CR      ; Default send EOL char.
  95. DREOL   EQU     CR      ; Default receive EOL char.
  96. DSSOH   EQU     SOH     ; Default send start-of-packet char.
  97. DRSOH   EQU     SOH     ; Default receive start-of-packet char.
  98. DSQUOT  EQU     23H     ; Default send quote char.
  99. DRQUOT  EQU     23H     ; Default receive quote char.
  100. DQBIN   EQU     26H     ; Default 8-bit prefix.
  101. DRPT    EQU     7EH     ; Default repeat prefix.
  102. DCHKLEN EQU     1       ; Default checksum length.
  103. DEFPAR  EQU     PARNON  ; Default parity (none.)
  104. IBMPAR  EQU     PARMRK  ; IBM's parity (mark.)
  105.  
  106. maxpack equ     1000    ; max packet length. Sets buffer sizes, capabilities.
  107. bufsiz  equ     1536    ; size of serial port input buffer
  108. buffsz  equ     512     ; size of disk file i/o buffer (buff). [jrd]
  109. cptsiz  equ     256     ; size of session capture buffer. [jrd]
  110. DMASIZ  EQU     80H     ; Size of DMA.
  111.  
  112. portmax equ     4       ; # of serial ports
  113.  
  114. ; baud rate definitions
  115. B00455  EQU     0       ; 45.5 baud
  116. B0050   EQU     1       ; 50 baud
  117. B0075   EQU     2       ; 75 baud
  118. B0110   EQU     3       ; 110 baud
  119. B01345  EQU     4       ; 134.5 baud
  120. B0150   EQU     5       ; 150 baud
  121. B0300   EQU     6       ; 300 baud
  122. B0600   EQU     7       ; 600 baud
  123. B1200   EQU     8       ; 1200 baud
  124. B1800   EQU     9       ; 1800 baud
  125. B2000   EQU     10      ; 2000 baud
  126. B2400   EQU     11      ; 2400 baud
  127. B4800   EQU     12      ; 4800 baud
  128. B9600   EQU     13      ; 9600 baud
  129. B19200  EQU     14      ; 19200 baud
  130. B38400  EQU     15      ; 38400 baud
  131. B57600  EQU     16      ; 57600 baud
  132. B115200 EQU     17      ; 115200 baud
  133. BAUDSIZ EQU     18      ; Number of options for baud rate.
  134.  
  135.                         ; bit defs for flags.capflg (LOG command).
  136. logoff  equ     0       ; Off = no or suspended logging
  137. logdeb  equ     1       ; log debugging (not yet imp)
  138. logpkt  equ     2       ; log packets sent/received
  139. logses  equ     4       ; log connect mode session
  140. logtrn  equ     8       ; log (file) transaction (n.y.i.)
  141.  
  142. ; Terminal emulator section
  143.  
  144. ; Kinds of terminals available; VT52 and VT100 for IBM & clones only.
  145. ttgenrc equ     0               ; Type 0: no emulation done by Kermit
  146. ttheath equ     1               ; Type 1: Heath-19
  147. ttvt52  equ     2               ; Type 2: VT52
  148. ttvt100 equ     3               ; Type 3: ANSI (VT102 subset)
  149. tttek   equ     4               ; Type 4: Tektronix 4010
  150. TTTYPES equ     5               ; Number of terminal types defined
  151.  
  152. ; VT100 status flags
  153. anslnm  equ     01H                     ; ANSI line feed/new line mode
  154. decckm  equ     02H                     ; VT100 cursor keys mode
  155. deckpam equ     04H                     ; VT100 keypad application mode
  156. decscnm equ     08H                     ; VT100 screen mode (n.y.i.)
  157. decom   equ     10H                     ; VT100 origin mode
  158. decawm  equ     20H                     ; VT100 autowrap mode
  159. decanm  equ     40H                     ; ANSI(VT100)/VT52 mode
  160. decmode equ     80H                     ; "?" seen in lead-in
  161.  
  162. ; VT100 SETUP mode flags (bit field in a byte)
  163. vsscreen        equ     40H             ; Screen (0 = normal, 1 = rev. video)
  164. vscursor        equ     20H             ; Cursor (0 = block, 1 = underline)
  165. vsmarginbell    equ     10H             ; Margin bell (0 = off)
  166. vskeyclick      equ     08H             ; Keyclick (0 = off)
  167. vsshift3        equ     04H             ; Shift-3 (0 = American pound sign #)
  168. vswrap          equ     02H             ; Line wrap around (0 = no wrap)
  169. vsnewline       equ     01H             ; ANSI new line (0 = off)
  170.  
  171. ; VT100 defaults for SETUP
  172. ; Note: Tab stops default to columns 9, 17, 25, 33, 41, 49, 57, 65, & 73.
  173. ; Adjust them via Set Term Tabs.
  174. ;
  175. ; VSDEFAULTS holds Kermit startup time settings for the VT100 emulator.
  176. ; Configure it by adding together names from the setup mode flags above
  177. ; to turn on features (they default to being off if not mentioned).
  178. ; Set the kind of terminal by placing a ttxxxx name in VTFLGS in the
  179. ; FLGINFO structure well below.
  180.  
  181. vsdefaults      equ     0+vscursor      ; + your favorite conditions.
  182.  
  183. emulst  struc                   ; structure for terminal emulator global data
  184. vtflgst db      0               ; VT100 setup flags
  185. vtflgop db      0               ; VT100 runtime flags, like setup flags
  186. vttbs   dw      0               ; pointer to default tab stops
  187. vttbst  dw      0               ; pointer to tab stops (both in mszibm)
  188. att_ptr dw      0               ; pointer to video attributes: nor, rev
  189. emulst  ends
  190. ; end of terminal emulator section
  191.  
  192. ; Structure definitions.
  193.  
  194. ; Modem information.
  195. mdminfo struc
  196. mddat   dw 0            ; Default to port 1.
  197. mdstat  dw 0            ; Ditto.
  198. mdcom   dw 0            ; Here too.
  199. mden    db 0
  200. mddis   db 0
  201. mdmeoi  db 0
  202. mdintv  dw 0
  203. mdminfo ends
  204.  
  205. ; Command information.
  206. cmdinfo struc
  207. cmstat  db 0            ; What is presently being parsed.
  208. cmaflg  db 0            ; Non-zero when an action char has been found.
  209. cmccnt  db 0            ; Non-zero if a significant char is found.
  210. cmsflg  db 0            ; Non-zero when the last char was a space.
  211. cmostp  dw 0            ; Old stack pointer for reparse.
  212. cmrprs  dw 0            ; Address to go to on reparse.
  213. cmprmp  dw 0            ; Address of prompt.
  214. cmptab  dw 0            ; Address of present keyword table.
  215. cmhlp   dw 0            ; Address of present help.
  216. cmdbuf  db 80H DUP(0)   ; Buffer for command parsing.
  217. cmcptr  dw 0            ; Pointer for next char input.
  218. cmdptr  dw 0            ; Pointer into the command buffer.
  219. cmsiz   dw 0            ; Size info of user input.
  220. cmkptr  dw 0            ; Pointer to keyword.
  221. cmsptr  dw 0            ; Place to save a pointer.
  222. cmchr   db 0            ; Save char when checking ambiguity.
  223. cmrflg  db 0            ; Assume parsing filename for send.
  224. cmcr    db 0            ; Say whether bare CR is allowed.
  225. cmquiet db 0            ; non-zero for no echoing...
  226. cmdinfo ends
  227.  
  228. ; Flags information.
  229. flginfo struc
  230. belflg  db 1            ; Use bell
  231. comflg  db 1            ; Use COM1 by default.
  232. abfflg  db 1            ; Discard incoming file if abort.
  233. debug   db 0            ; Debugging mode (default off).
  234. flwflg  db 1            ; File warning flag (default on).
  235. ibmflg  db 0            ; IBM flag (default off).
  236. extflg  db 0            ; Exit flag (default off).
  237. vtflg   db ttvt100      ; term emulation (0=none, 1=Heath19, 2=VT52, 3=VT100)
  238. nmoflg  db 0            ; Override name from the F packet.
  239. cxzflg  db 0            ; ^X/^Z to interrupt file x-fer.
  240. xflg    db 0            ; Seen "X" packet.
  241. filflg  db 0            ; Non-zero when nothing in DMA buffer.
  242. eoflag  db 0            ; EOF flag; non-zero on EOF.
  243. getflg  db 0            ; Assume normal RECEIVE (not GET).
  244. capflg  db 0            ; On if capturing data.
  245. takflg  db 0            ; On if echoing commands of TAKE file.
  246. timflg  db 1            ; Say if are timing out or not. [jrd]
  247. destflg db 1            ; Incoming files destination: disk or printer.
  248. eofcz   db 0            ; ^Z signals eof if non-zero.
  249. remflg  db DREGULAR     ; server (remote) mode plus display flag bits
  250. modflg  db 1            ; non-zero if mode line on.
  251. wrpflg  db 0            ; non-zero if line wrap is to be done
  252. flginfo ends
  253.  
  254. ; Transmission parameters
  255. trinfo  struc
  256. maxdat  dw 0            ; Max packet size for send, word for long packets
  257. chklen  db 1            ; Number of characters in checksum.
  258. seol    db dseol        ; Send EOL char.
  259. reol    db dreol        ; Receive EOL char.
  260. ssoh    db dssoh        ; Send start-of-packet character.
  261. rsoh    db drsoh        ; Receive start-of-packet character.
  262. squote  db dsquot       ; Send quote character.
  263. rquote  db drquot       ; Receive quote character.
  264. spsiz   db dspsiz       ; Send packet size.
  265. rpsiz   db drpsiz       ; Receive packet size.
  266. stime   db dstime       ; Send timeout. (Don't timeout).
  267. rtime   db drtime       ; Receive timeout.
  268. sdelay  db 0            ; Send delay time (sec) for just SEND command.
  269. spad    db dspad        ; Send padding.
  270. rpad    db drpad        ; Receive padding.
  271. spadch  db dspadc       ; Send padding char.
  272. rpadch  db drpadc       ; Receive padding char.
  273. ebquot  db 'Y'          ; Send 8-bit quote character.
  274. escchr  db defesc       ; Escape character.
  275.                         ; new fields for long packets
  276. capas   db 2            ; Capas byte, just long packets, needs a name.
  277. windo   db 0            ; window size (not used, yet)
  278. lentyp  dw 3            ; packet length type (3=regular, 0=long, 1=extra long)
  279. rlongp  dw drpsiz       ; long pkt size we want to receive
  280. slongp  dw maxpack      ; long pkt size we could send (negotiated with host)
  281. slong   dw maxpack      ; longest pkt size we will send, from Set Send Pkt
  282. trinfo  ends
  283.  
  284. pktinfo struc
  285. pktnum  dw 0            ; Packet number.
  286. numpkt  dw 0            ; Total number of packets sent.
  287. numrtr  dw 0            ; Total number of retries.
  288. numtry  db 0            ; Number of tries on this packet.
  289. state   db 0            ; Present state of the automaton.
  290. argblk  dw 0            ; For subroutine arguments. packet SEQ number
  291. argbk1  dw 0            ; length of data field in a packet
  292. argbk2  dw 0
  293. argbk3  dw 0            ; packet length type (3=regular, 0=long, 1=extra long)
  294. pktinfo ends
  295.  
  296. filest  struc           ; [jrd]
  297. handle  dw 0            ; DOS 2.0 file handle
  298. string  db 64 dup(0)    ; complete filename string, including drive and path
  299. dta     db 26 dup(0)    ; 21 resev'd bytes, file attr, 2 each date & time
  300. sizelo  dw 0            ; file size, 4 bytes, part of dta
  301. sizehi  dw 0
  302. fname   db 13 dup(0)    ; filename, asciiz, with dot, part of dta
  303. fstat   db 0            ; status of Find First DOS call
  304. filest  ends
  305.  
  306. takinfo struc
  307. taktyp  db 0            ; type: 0feH=valid file handle, 0ffH=a macro [jrd]
  308. takhnd  dw 0            ; file handle [jrd]
  309. takbuf  db dmasiz dup(0)
  310. takptr  dw 0
  311. takchl  db 0
  312. takcnt  dw 0,0
  313. takinfo ends
  314.  
  315. ; Port Information.
  316. prtinfo struc
  317. baud    dw 0            ; Default baud rate.
  318. ecoflg  db 0            ; Local echo flag (default off).
  319. parflg  db 0            ; Parity flag (default none.)
  320. floflg  db 0            ; If need flow control during file x-fer.
  321. hndflg  db 0            ; If need handshake during file x-fer.
  322. hands   db 0            ; Default handshake.
  323. flowc   dw 0            ; Do flow control with XON/XOFF.
  324. prtinfo ends
  325.  
  326.  
  327. statinfo struc                  ; statistics, basic information layout
  328. prbyte  dw      2 dup (0)       ; number of bytes received by port
  329. psbyte  dw      2 dup (0)       ; number of bytes sent to port
  330. frbyte  dw      2 dup (0)       ; bytes received
  331. fsbyte  dw      2 dup (0)       ; bytes sent
  332. prpkt   dw      2 dup (0)       ; number of packets received
  333. pspkt   dw      2 dup (0)       ; number of packets sent
  334. nakrcnt dw      0               ; count of naks received
  335. nakscnt dw      0               ; count of naks sent
  336. btime   dw      2 dup (0)       ; start time (seconds) of transfer
  337. etime   dw      2 dup (0)       ; elapsed time (seconds) of transfer
  338. statinfo ends
  339.  
  340.  
  341. mkeyw   macro   key,val
  342.         local   junk,oldval
  343. oldval  equ     $
  344.         db      junk,key,'$'
  345. junk    equ     $-oldval-2
  346.         dw      val
  347.         endm
  348.  
  349.  
  350. ; definitions for terminal handler:
  351.  
  352. termarg struc
  353. flgs    db 0            ; flags
  354. prt     db 0            ; port to use (0,1)
  355. cols    db 0            ; # columns on screen
  356. rows    db 0            ; # rows on screen
  357. captr   dw 0            ; routine to call with captured data
  358. belld   dw 0            ; bell divisor
  359. klen    dw 0            ; length of key redefinition table
  360. ktab    dw 0            ; address of key redefinition table
  361. krpl    dw 0            ; address of key replacement table
  362. escc    db 0            ; escape character
  363. baudb   db 0            ; baud rate bits.
  364. parity  db 0            ; parity
  365. termarg ends
  366.  
  367. ; bits for flag byte
  368. scrsam  equ 80h         ; on if shouldn't redraw screen
  369. capt    equ 40h         ; capture output
  370. emheath equ 20h         ; emulate heath
  371. havtt   equ 10h         ; have translate table
  372. trnctl  equ 08h         ; translate control chars
  373. modoff  equ 04h         ; mode line off
  374. lnwrap  equ 02h         ; auto-wrap long lines
  375. lclecho equ 01h         ; local echo
  376.  
  377. ;
  378. ; Note well. The following segment references are in THIS file to provide
  379. ; the desired ordering of them in memory. To wit: lowest addresses for
  380. ; 'code', followed by 'cstack', and only then by 'datas'. The code below
  381. ; causes the assembler to encounter the segments in this desired order. It
  382. ; may output them in either order-of-encounter or alphabetically (since they
  383. ; are forced to be synonymous); and it allows the linker to place them in
  384. ; either its order-of-encounter or alphabetically.  If you are in doubt as to
  385. ; what your utilities do then ask the linker for a memory map and ensure the
  386. ; order is as stated above. Joe R. Doupnik 26 Dec 1985. [jrd]
  387.  
  388. code    segment public 'code'
  389. code    ends
  390. cstack  segment para stack 'stack'
  391. cstack  ends
  392. datas   segment public 'datas'
  393. datas   ends
  394.         .list
  395.