home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / flex1 / flxpt2.txt < prev    next >
Text File  |  2020-01-01  |  4KB  |  253 lines

  1.  
  2. start ldx #int
  3.  STX $f3c8
  4.  lda #3
  5.  sta line
  6.  lda #%00010101
  7.  lda #%10010101
  8.  sta line polled tx int rx
  9.  lda #suspec suspend character
  10.  sta suspend
  11.  ldx #startq
  12.  stx inp
  13.  stx outp set up line que
  14.  clr count
  15.  clr fcs
  16.  lda #xon
  17.  sta lastf
  18.  clr monito
  19.  clr tmode
  20.  clr pnum
  21.  clr pdlen
  22.  clr ptype
  23.  clr size
  24.  clr chksum
  25.  clr fld
  26.  clr rstat
  27.  clr ebqmod
  28.  clr datind
  29.  clr chebo
  30.  clr kerchr
  31.  clr delay
  32.  lda #dmaxtr
  33.  sta maxtry
  34.  lda #debq
  35.  sta rebq
  36.  sta sebq
  37.  lda #dpadln
  38.  sta rpad
  39.  sta spad
  40.  lda #dpadch
  41.  sta rpadch
  42.  sta spadch
  43.  lda #deol
  44.  sta reol
  45.  sta seol
  46.  lda #dpakln
  47.  sta rpsiz
  48.  sta spsiz
  49.  lda #dtime
  50.  sta rtime
  51.  sta stime
  52.  lda #dquote
  53.  sta rquote
  54.  sta squote
  55.  cli
  56.  jmp main
  57.  
  58.  FCB $74,$35,$7A,$29,$6C,$8B,$77,$32,$68,$8C,$79,$36,$70,$30,$71,$8D
  59. main equ * main loop and despatcher
  60.  ldy #$3000
  61.  sty point
  62.  ldx #prompt
  63.  jsr pstr issue welcome prompt
  64.  ldx #menu1
  65.  jsr pstr find out what user wants to do
  66.  lda cons+1
  67.  lda cons+1 clean i/f
  68.  jsr cinput
  69.  jsr coutch echo reply
  70.  cmpa #'0
  71.  lbeq term term emulation to line
  72.  cmpa #'2
  73.  lbeq send file transfer (kermit)
  74.  cmpa #'1
  75.  lbeq flexex return to flex
  76.  cmpa #'3
  77.  lbeq receve receive a file (kermit)
  78.  cmpa #'4
  79.  lbeq close
  80.  cmpa #'5
  81.  beq monon
  82.  cmpa #'6
  83.  beq monoff
  84.  bra main
  85.  
  86. monon sta monito
  87. mmsg ldx #mdone
  88.  jsr pstr
  89.  bra main
  90.  
  91. monoff clr monito
  92.  bra mmsg
  93.  
  94. *************************************************
  95. *terminal emulation******************************
  96.  
  97. term equ *
  98.  ldx #escstr tell user how tp break out
  99.  jsr pstr
  100. terml jsr cinchk any console i/p
  101.  beq lhand no
  102.  bit b #$10 test for <break>
  103.  bne berr yes
  104.  jsr cinput read data
  105.  cmpa suspend
  106.  lbeq main    exit at user request
  107.  
  108. sendl jsr loutch send it to line
  109.  bra lhand
  110.  
  111. berr lda cons+1 set line i/f to space
  112.  sei
  113.  lda #%11110101
  114.  sta line
  115.  ldx #$ffff
  116. wait dex
  117.  INX
  118.  DEX
  119.  bne wait
  120.  lda #%10110101 restore i/f
  121.  sta line
  122.  cli
  123.  
  124. lhand equ *
  125.  jsr coutck ok to tx?
  126.  beq terml no
  127.  tst count que empty?
  128.  beq terml yes
  129.  jsr unque
  130.  jsr coutch send it
  131.  bra terml
  132.  
  133. ************************************
  134. flexex lda #$03   return to flex
  135.  sta line reset i/f causing ints
  136.  jmp $cd03 and warmstart to flex
  137. *********************************
  138.  
  139. ************************************
  140. *line handler and other subrs.
  141.  
  142. qures equ *
  143.  sei
  144.  pshs x
  145.  ldx #startq
  146.  stx inp
  147.  stx outp
  148.  clr count
  149.  puls x
  150.  cli
  151.  rts
  152.  
  153. cinchk equ *
  154.  pshs a see if data from console
  155.  ldb cons
  156.  bitb #1
  157.  puls a,pc
  158.  
  159. cinput bsr cinchk
  160.  beq cinput no rxd
  161.  lda cons+1
  162.  anda #$7f
  163.  rts
  164.  
  165. loutck pshs a see if line ok to tx
  166.  lda line
  167.  bit a #2
  168.  puls a,pc
  169.  
  170. telppc equ *
  171. loutch bsr loutck
  172.  beq loutch o/p to line
  173.  sta line+1
  174.  rts
  175.  
  176. pstr lda #$0d
  177.  jsr couts
  178.  lda #$0a
  179.  jsr couts
  180. pstrs lda 0,x+ send string to console
  181.  cmpa #eom
  182.  beq pstre end of message
  183.  jsr couts send char
  184.  bra pstrs
  185. pstre rts
  186.  
  187. getplc equ *
  188.  ldy #$ffff abort i/p timeout timer
  189. getplt cmpy #$0000
  190. *beq toexit timeout occured
  191.  leay -1,y keep timing
  192.  tst count
  193.  bne unque got data
  194.  jsr cinchk
  195.  beq getplt no console rx
  196.  jsr cinput get data
  197.  cmpa suspend
  198.  bne getplt not abort
  199. toexit leas 2,s equiv to an rts
  200.  jmp rpkfls handle console abort back in kermit
  201. unque equ * count must be checked as non 0 before entry
  202.  sei
  203.  pshs b,x
  204.  ldx outp
  205.  lda 0,x+ read char from line buffer
  206.  cmpx #end
  207.  bne un1
  208.  ldx #startq
  209. un1 stx outp
  210.  dec count
  211.  ldb count
  212.  cli
  213.  cmpb #xlo
  214.  bne unx
  215.  ldb #xon  send xon if reqd
  216.  cmpb lastf last code sent?
  217.  beq unx was an xon !
  218.  stb lastf
  219.  stb fcs set up for tx of an xon
  220.  ldb #%10110101
  221.  stb line set tx int on
  222. unx puls b,x,pc
  223.  
  224. couts jsr coutck
  225.  beq couts
  226.  bra coutch
  227.  
  228. coutch equ *
  229.  sta cons+1 send data to console
  230. cexit rts
  231.  
  232. coutcr jsr coutck
  233.  beq coutcr
  234.  bsr coutch o/p data
  235.  cmpa #cr
  236.  bne cexit
  237.  pshs a
  238.  lda #lf if cr then crlf
  239. coutlf jsr coutck
  240.  beq coutlf
  241.  jsr coutch
  242.  puls a get back cr !
  243.  rts
  244.  
  245.  
  246. coutck equ * see if can send to console
  247.  pshs a
  248.  lda cons
  249.  bita #2
  250.  puls a,pc
  251.  
  252.  
  253.