home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / archives / trs80model2.zip / trsdata.mac < prev    next >
Text File  |  1997-03-26  |  7KB  |  195 lines

  1.         subttl  data segment
  2.         dseg
  3.         ;
  4.         ;       state symbols
  5.         ;
  6.         _a      equ     1       ;abort
  7.         _c      equ     2       ;complete
  8.         _r      equ     3       ;receive init
  9.         _rf     equ     4       ;receive file header
  10.         _rd     equ     5       ;receive data
  11.         _s      equ     6       ;send init
  12.         _sf     equ     7       ;send file header
  13.         _sd     equ     8       ;send data
  14.         _se     equ     9       ;send end-of-file
  15.         _sb     equ     10      ;send break transmission
  16.         _o      equ     11      ;open file (pre send init)
  17.         _end    equ     255
  18. ;
  19.         public  fcb,filbuf,recptr,recbuf,paraml,lrecl
  20.         public  create,byte,word,screen,rftab,rdtab
  21.         public  slen,spaket,rlen,rpaket,sinit
  22.         public  rinit,port,baud,wdlen,baudtb,lab,parsetb
  23.         public  parity,stop,oldstk,scrtch,cmdlin,high
  24.         public  state,n,r,init,ssvc,rsvc,csvc,altsvc
  25.         public  nsvc,stack,stjump,rtype
  26.         extrn   abort,exit,r_init,r_file,r_data
  27.         extrn   rf_f,rf_b,rf_x,rd_d,rd_z
  28.         extrn   s_open,s_file,s_data,s_eof,s_break,s_init
  29.         public  filnam,crp,cbp,work
  30.         extrn   eof,sets,setr,setb,setf,setp,setc,setw,seter
  31.         extrn   setl
  32.         ;
  33.         ;       fcb and others file related matters
  34.         ;
  35.         filnam: ds      30      ;will hold filename for send
  36.         fcb:    ds      60      ;file control block
  37.         filbuf: ds      512     ;file buffer
  38.         crp:
  39.         recptr: db      0       ;
  40.         recbuf: ds      256     ;record buffer
  41.         paraml: dw      filbuf  ;parameter list for file svc's
  42.                 dw      recbuf
  43.                 dw      eof     ;send end of file routine
  44.                 db      'W'     ;read/write
  45.         lrecl:  db      1       ;default is 1
  46.                 db      'F'     ;always fixed record length
  47.         create: db      2       ;default is create
  48.                 db      0       ;user attrib = 0
  49.         ;
  50.         ;       packet buffers
  51.         ;
  52.         cbp:
  53.         slen:   db      0       ;send buffer length (all included)
  54.         spaket: ds      100     ;send packet
  55.         rlen:   db      0       ;receive buffer length
  56.         rpaket: dw      0       ;receive packet store
  57.         rtype:  ds      100     ;here is where we store type
  58.         ;
  59.         ;       the send init exchange
  60.         ;
  61.         sinit:  db      13      ;will contain the send init received
  62.                 db      13,13,13,13,13,13,13,13,13,13,13
  63.         maxlen  equ     94      ;maximum packet length
  64.         tout    equ     10      ;time out
  65.         quote   equ     '#'
  66.         cr      equ     13      ;carriage return (eol)
  67.         rinit:                  ;the send-init we will send
  68.                 db      maxlen+32
  69.                 db      tout+32
  70.                 db      0+32
  71.                 db      64
  72.                 db      cr+32   ;eol
  73.                 db      quote
  74.                 db      'N'
  75.                 db      '1'
  76.                 db      ' '
  77.                 db      32
  78.         ;       telecomm buffers
  79.         ;
  80.         port:   db      'A'             ;default is A
  81.         baud:   db      8               ;baud rate (9600)
  82.         wdlen:  db      8               ;8 bits' byte
  83.         parity: db      'N'             ;none
  84.         stop:   db      1
  85.                 db      0               ;end
  86.         ;
  87.         ;       misc
  88.         ;
  89.         oldstk: dw      0               ;save stack here on entry
  90.         scrtch: dw      0               ;last+1 byte of pgm on entry
  91.         cmdlin: dw      0               ;address of command line
  92.         byte:   db      0               ;scratch byte
  93.         word:   dw      0               ;scratch word
  94.         work:                           ;work space for parser
  95.                 db      '0','0','0','0','0'
  96.         screen: db      0               ;flag for typing on screen
  97.         ;
  98.         high:   dw      0               ;high memory
  99.         state:  db      3               ;current state of automaton
  100.         n:      db      0               ;current packet number
  101.         r:      db      0               ;current retry count
  102.         init:   db      0               ;do comm init on entry if != 0
  103.         ;
  104.         ;       svc for comm operations
  105.         ;
  106.         ssvc:   db      97              ;send on channel A
  107.         rsvc:   db      96              ;receive on channel A
  108.         csvc:   db      100             ;control on channel A
  109.         altsvc: db      0,99,98,101     ;same for channel B
  110.         nsvc:   db      4               ;number of bytes to move
  111.         ;
  112.         ;       stack
  113.         ;
  114.                 ds      400             ;lots of space
  115.         stack:
  116.         stjump: db      _a              ;main jump table
  117.                 dw      abort
  118.                 db      _c
  119.                 dw      exit
  120.                 db      _r
  121.                 dw      r_init
  122.                 db      _rf
  123.                 dw      r_file
  124.                 db      _rd
  125.                 dw      r_data
  126.                 db      _o
  127.                 dw      s_open
  128.                 db      _s
  129.                 dw      s_init
  130.                 db      _sf
  131.                 dw      s_file
  132.                 db      _sd
  133.                 dw      s_data
  134.                 db      _se
  135.                 dw      s_eof
  136.                 db      _sb
  137.                 dw      s_break
  138.                 db      _end            ;end of table
  139.  
  140.         rftab:  db      _a
  141.                 dw      abort
  142.                 db      'F'
  143.                 dw      rf_f
  144.                 db      'B'
  145.                 dw      rf_b
  146.                 db      'X'
  147.                 dw      rf_x
  148.                 db      _end
  149.  
  150.         rdtab:  db      _a
  151.                 dw      abort
  152.                 db      'D'
  153.                 dw      rd_d
  154.                 db      'Z'
  155.                 dw      rd_z
  156.                 db      _end
  157.         ;
  158.         baudtb:
  159.                 db      '110 ',1
  160.                 db      '150 ',2
  161.                 db      '300 ',3
  162.                 db      '600 ',4
  163.                 db      '1200',5
  164.                 db      '2400',6
  165.                 db      '4800',7
  166.                 db      '9600',8
  167.                 db      13                      ;end of table
  168.         lab:
  169.                 dw      l1,l2,0
  170.         l1:
  171.                 db      3,'{}',13
  172.         l2:
  173.                 db      1,'/'
  174.         parsetb:
  175.                 db      0
  176.                 dw      seter
  177.                 db      'W'
  178.                 dw      setw
  179.                 db      'S'
  180.                 dw      sets
  181.                 db      'R'
  182.                 dw      setr
  183.                 db      'F'
  184.                 dw      setf
  185.                 db      'P'
  186.                 dw      setp
  187.                 db      'B'
  188.                 dw      setb
  189.                 db      'C'
  190.                 dw      setc
  191.                 db      'L'
  192.                 dw      setl
  193.                 db      _end
  194.                 end
  195.