home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / ccdos / ccsdef.h < prev    next >
Text File  |  2020-01-01  |  19KB  |  471 lines

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