home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / UNIFLEX / UNIFLEX / UniFLEX_Std.Utils1.tar.Z / UniFLEX_Std.Utils1.tar / utils1 / nfx < prev    next >
Text File  |  1981-10-09  |  14KB  |  854 lines

  1.  opt nol,pag
  2.  ttl Free block check program
  3.  lib sysdef
  4.  opt lis
  5.  pag
  6.  
  7.  info UniFLEX blockcheck
  8.  info Version 1, Released January 19, 1981
  9.  info Copyright, (C) 1981, by
  10.  info Technical Systems Consultants, Inc.
  11.  info All rights reserved.
  12.  
  13.  org 0
  14.  
  15. * Free block check program
  16.  
  17. fch sys update update the system
  18.  ldd 0,s get arg count
  19.  cmpd #2 is it ok?
  20.  bne fch8 error?
  21.  ldd 4,s get arg
  22.  std iopn2 set sys call
  23.  sys ind,iopn open the device
  24.  bes fch8 error?
  25.  std dfd save file desc
  26. * check for block type device
  27.  ldd dfd get file desc
  28.  sys seek,0,512,0 seek to sir
  29.  ldd dfd
  30.  sys read,sir,512 read in the sir
  31.  bes fch8
  32.  ldd sir+16 get fdn block count
  33.  std fdcnt save it
  34.  addd #2 set 1st avail block number
  35.  std frbl
  36.  tst sir+18 check if too big for this program (65000 max blocks)
  37.  bne fch8
  38.  ldd sir+19 get volume size
  39.  std vlcnt save it
  40.  ldx #bm point to bit map
  41.  ldd #0
  42. fch4 std 0,x++ zero bit map
  43.  cmpx #bm+BMSZ end of map?
  44.  bne fch4
  45. * jsr frl find free list blocks
  46.  jsr fdn find allocated blocks
  47.  jsr filin fill in rest of map
  48.  jsr lost report lost blocks
  49.  jsr dobld build new free list
  50.  ldd #0
  51.  sys term exit
  52. fch8 swi temp error routine
  53.  
  54. *
  55. * Output number in D
  56. *
  57.  
  58. ostr ldx #stbf point to buffer
  59.  jsr decst convert number to string
  60.  std iwrt3 save in call
  61.  ldd #stbf set string begin
  62.  std iwrt2
  63.  ldd #1 set file desc
  64.  sys ind,iwrt output number
  65.  rts return
  66.  
  67. *
  68. * print string routines
  69. *
  70.  
  71. npms pshs x save string ptr
  72.  bsr ostr print number
  73.  puls x
  74. pms stx iwrt2 set string in call
  75.  ldd #0 set counter
  76. pms2 tst 0,x+ find string end
  77.  beq pms3
  78.  incb
  79.  bra pms2
  80. pms3 std iwrt3 save count
  81.  ldd #1 set output
  82.  sys ind,iwrt
  83.  rts return
  84.  
  85. *
  86. * Find all blocks in free list
  87. *
  88.  
  89. frl ldd #0 zero counters
  90.  std fbc
  91.  std oorfb
  92.  std dupbc
  93.  ldx #sir+$bd point to incore free list
  94.  ldb 0,x+ get count
  95.  beq frl6 no free?
  96. frl2 bsr gb get blocks from list
  97.  tst 0,x bad block?
  98.  bne frl8
  99.  ldd 1,x get link block
  100.  beq frl6 end of list?
  101.  cmpd vlcnt in range?
  102.  bhi frl8
  103.  cmpd frbl
  104.  blo frl8
  105.  jsr rfb read in block
  106.  ldx #bbuf point to block data
  107.  ldb #100 set block count
  108.  bra frl2
  109. frl6 rts return
  110. frl8 ldx #bdlne print error
  111.  jsr pms
  112.  ldd #0
  113.  sys term exit
  114.  
  115. *
  116. * Get blocks from free list
  117. *
  118.  
  119. gb pshs b save count
  120.  ldb 0,s
  121.  decb find block start location
  122.  lda #3 3 bytes per block
  123.  mul
  124.  leax d,x point to end of list
  125. gb2 tst 0,x out of range?
  126.  beq gb4
  127. gb3 swi
  128.  ldd oorfb get counter
  129.  addd #1 bump by one
  130.  std oorfb save new
  131.  bra gb5
  132. gb4 ldd 1,x get block number
  133.  beq gb5
  134.  cmpd vlcnt check if in range
  135.  bhi gb3
  136.  cmpd frbl
  137.  blo gb3
  138.  bsr smap set block in map
  139.  ldd fbc get free count
  140.  addd #1 bump it
  141.  std fbc
  142. gb5 leax -3,x get to next entry
  143.  dec 0,s dec the count
  144.  bne gb2 finished?
  145.  leax 3,x fix pointer
  146.  puls b,pc return
  147.  
  148. *
  149. * read in block in d
  150. *
  151.  
  152. dfsk std isk3 save blocj number
  153.  clr isk2
  154.  lsl isk3+1 mult by 512 char per block
  155.  rol isk3
  156.  rol isk2
  157.  ldd dfd get file desc
  158.  sys ind,isk seek to block
  159.  ldd dfd
  160.  rts
  161. *
  162. rfb bsr dfsk
  163.  sys read,bbuf,512 read block
  164.  lbes drder error?
  165.  rts return
  166.  
  167. *
  168. * Set bit map bit for block in d
  169. *
  170.  
  171. smap pshs x save x
  172.  bsr map find map location
  173.  bita 0,x bit already set?
  174.  bne smap2
  175.  ora 0,x set bit
  176.  sta 0,x
  177.  puls x,pc return
  178. smap2 ldd dupbc get dup count
  179.  addd #1 bump it
  180.  std dupbc
  181.  puls x,pc return
  182.  
  183. *
  184. * Find bit map location
  185. *
  186.  
  187. map ldx #bm point to map
  188.  pshs b save low byte
  189.  lsra divide by 8
  190.  rorb
  191.  lsra
  192.  rorb
  193.  lsra
  194.  rorb
  195.  leax d,x point to entry
  196.  lda #$80 set bit
  197.  puls b get low byte
  198.  andb #$7
  199.  beq map4
  200. map2 lsra adjust bit pos
  201.  decb
  202.  bne map2
  203. map4 rts return
  204.  
  205. *
  206. * filin
  207. *
  208.  
  209. filin ldd #0
  210.  pshs d
  211. filin2 jsr map fill in system blocks
  212.  ora 0,x set bit
  213.  sta 0,x
  214.  ldd 0,s get block count
  215.  addd #1
  216.  std 0,s
  217.  cmpd frbl end of fdn blocks?
  218.  bne filin2
  219.  puls d,pc return
  220.  
  221. *
  222. * Find all file blocks from the fdns
  223. *
  224.  
  225. fdn ldd #0 set counter
  226.  pshs d
  227. fdn2 addd #2 find fdn block number
  228.  jsr dfsk seek to it
  229.  sys read,fdbuf,512 read in fdn block
  230.  lbes drder error?
  231.  ldu #fdbuf point to fdns
  232.  ldb #512/64 set fdn per block count
  233.  pshs b
  234. fdn4 pshs u
  235.  bsr dof process an fdn
  236.  puls u
  237.  leau 64,u move to next fdn
  238.  dec 0,s dec the count
  239.  bne fdn4
  240.  puls b
  241.  ldd 0,s get fdn counter
  242.  addd #1 bump by 1
  243.  std 0,s
  244.  cmpd fdcnt finished?
  245.  blo fdn2
  246.  puls d,pc return
  247.  
  248. *
  249. * Process the data in the fdn pointed at by U.
  250. *
  251.  
  252. dof clr dir clear mode flags
  253.  lda 0,u get modes
  254.  bne dof1 is it active?
  255.  ldd ffdc get free fdn counter
  256.  addd #1 update it
  257.  std ffdc
  258.  rts return
  259. dof1 pshs a save modes
  260.  ldd ufdc get used fdn count
  261.  addd #1 update it
  262.  std ufdc
  263.  puls a
  264.  bita #$2 is it block device?
  265.  beq dof2
  266.  ldd bfc get count
  267.  addd #1 update
  268.  std bfc
  269.  rts return
  270. dof2 bita #$4 is it char device?
  271.  beq dof3
  272.  ldd cfc get count
  273.  addd #1 update it
  274.  std cfc
  275.  rts return
  276. dof3 bita #$8 is it a dir?
  277.  beq dof35
  278.  inc dir set dir flag
  279.  ldd dfc get counter
  280.  addd #1
  281.  std dfc
  282.  bra dof4
  283. dof35 ldd rfc get reg file block counter
  284.  addd #1 update it
  285.  std rfc
  286. dof4 bsr ffb procress blocks
  287.  rts return
  288.  
  289. *
  290. * Find all blocks in the fdn pointed at by U.
  291. *
  292.  
  293. ffb leau 9,u point to map
  294.  ldb #10 process direct map first
  295.  pshs b save counter
  296. ffb2 jsr torfb in range?
  297.  bne ffb3
  298.  ldd 1,u get block number
  299.  beq ffb3 is it null?
  300.  jsr sfmap set bit in map
  301. ffb3 leau 3,u get to next
  302.  dec 0,s end of direct?
  303.  bne ffb2
  304.  puls b
  305.  jsr torfb in range?
  306.  bne ffb4
  307.  ldd 1,u get single ind block
  308.  beq ffb4
  309.  bsr sind process it
  310. ffb4 leau 3,u get double ind block
  311.  jsr torfb in range?
  312.  bne ffb5
  313.  ldd 1,u
  314.  beq ffb5
  315.  jsr dind process it
  316. ffb5 leau 3,u get triple ind block
  317.  jsr torfb in range?
  318.  bne ffb6
  319.  ldd 1,u
  320.  beq ffb6
  321.  jsr tind process it
  322. ffb6 rts return
  323.  
  324. *
  325. * Process single ind block
  326. *
  327.  
  328. sind inc sin set mode
  329.  pshs d save block
  330.  jsr sfmap set map bit
  331.  puls d
  332.  jsr rfb read in block
  333.  ldx #bbuf point to data
  334.  ldb #128 set counter
  335.  pshs b
  336. sind2 jsr torbx in range?
  337.  bne sind4
  338.  ldd 1,x get block number
  339.  beq sind4
  340.  inc rbflg
  341.  jsr sfmap set block in map
  342.  clr rbflg
  343. sind4 leax 3,x get next entry
  344.  dec 0,s dec the count
  345.  bne sind2
  346.  clr sin clear mode
  347.  puls b,pc return
  348.  
  349. *
  350. * Process double ind block
  351. *
  352.  
  353. dind inc din set mode
  354.  pshs d save block
  355.  jsr sfmap set map bit
  356.  puls d
  357.  jsr rdib read in block
  358.  ldx #dbuf point to data
  359.  ldb #128 set counter
  360.  pshs b
  361. dind2 jsr torbx in range?
  362.  bne dind4
  363.  ldd 1,x get block number
  364.  beq dind4
  365.  pshs x
  366.  jsr sind process as single
  367.  puls x
  368. dind4 leax 3,x get next entry
  369.  dec 0,s dec the count
  370.  bne dind2
  371.  clr din clear mode
  372.  puls b,pc return
  373.  
  374. *
  375. * Process triple ind block
  376. *
  377.  
  378. tind inc tin set mode
  379.  pshs d save block
  380.  jsr sfmap set map bit
  381.  puls d
  382.  jsr rtib read in block
  383.  ldx #tbuf point to data
  384.  ldb #128 set counter
  385.  pshs b
  386. tind2 jsr torbx in range?
  387.  bne tind4
  388.  ldd 1,x get block number
  389.  beq tind4
  390.  pshs x
  391.  jsr dind process as double
  392.  puls x
  393. tind4 leax 3,x get next entry
  394.  dec 0,s dec the count
  395.  bne tind2
  396.  clr tin clear mode
  397.  puls b,pc return
  398.  
  399. *
  400. * Set bit map bit for file allocated block
  401. *
  402.  
  403. sfmap pshs d,x
  404.  jsr tbnd in range?
  405.  bne sfmap8
  406.  tst rbflg reg block?
  407.  bne sfmap3
  408.  tst tin find the block type
  409.  beq sfmap1 and bump its counter
  410.  ldd tindc
  411.  addd #1
  412.  std tindc
  413.  bra sfmap5
  414. sfmap1 tst din is it double?
  415.  beq sfmap2
  416.  ldd dindc
  417.  addd #1
  418.  std dindc
  419.  bra sfmap5
  420. sfmap2 tst sin single ind block?
  421.  beq sfmap3
  422.  ldd sindc
  423.  addd #1
  424.  std sindc
  425.  bra sfmap5
  426. sfmap3 tst dir is it dir block?
  427.  beq sfmap4
  428.  ldd dirbc
  429.  addd #1
  430.  std dirbc
  431.  bra sfmap5
  432. sfmap4 ldd rgfbc must be reg file block
  433.  addd #1
  434.  std rgfbc
  435. sfmap5 puls d get block number
  436.  jsr map find in bit map
  437.  bit a 0,x is it already there?
  438.  bne sfmap6
  439.  ora 0,x set bit on
  440.  sta 0,x
  441.  puls x,pc return
  442. sfmap6 ldd dupfc get dup count
  443.  addd #1 bump it
  444.  std dupfc
  445.  puls x,pc return
  446. sfmap8 puls d,x,pc return
  447.  
  448. *
  449. * reads for double & triple indirection
  450. *
  451.  
  452. rdib jsr dfsk do seek
  453.  sys read,dbuf,512
  454.  lbes drder error?
  455.  rts
  456. *
  457. rtib jsr dfsk do seek
  458.  sys read,tbuf,512
  459.  lbes drder error?
  460.  rts return
  461.  
  462. *
  463. * lost
  464. *
  465.  
  466. lost ldd vlcnt get volume block count
  467.  lsra divide by 8
  468.  rorb
  469.  lsra
  470.  rorb
  471.  lsra
  472.  rorb
  473.  pshs d save result
  474.  ldx #bm point to bit map
  475. lost2 lda 0,x+ get a byte
  476.  cmpa #$ff all filled in?
  477.  beq lost5
  478.  ldb #8 set bit count
  479.  bsr cntms count missing blocks
  480. lost5 ldd 0,s get block count
  481.  subd #1
  482.  std 0,s
  483.  bne lost2 finished?
  484.  ldb vlcnt+1 get remainder
  485.  andb #7
  486.  beq lost8
  487.  lda 0,x get reset of bits
  488.  bsr cntms count missing blocks
  489. lost8 puls d,pc return
  490.  
  491. *
  492. * count missing blocks
  493. *
  494.  
  495. cntms rola
  496.  bcs cntms4 missing bit?
  497.  pshs d
  498.  ldd mbcnt get missing count
  499.  addd #1
  500.  std mbcnt
  501.  puls d
  502. cntms4 decb dec the count
  503.  bne cntms
  504.  rts return
  505.  
  506. *
  507. * out of range block tests
  508. *
  509.  
  510. torbx tst 0,x hi byte set
  511.  bne torfb2
  512.  rts return
  513. torfb tst 0,u in range?
  514.  bne torfb2
  515.  rts
  516. torfb2 ldd oorflb get block counter
  517.  addd #1 bump it
  518.  std oorflb
  519.  rts return
  520. *
  521. tbnd cmpd vlcnt past volume end?
  522.  bhi torfb2
  523.  cmpd frbl in fdns?
  524.  blo torfb2
  525.  sez set status ok
  526.  rts return
  527.  
  528. *
  529. * report read error
  530. *
  531.  
  532. drder ldx #drdms
  533.  jsr pms
  534.  ldd #0
  535.  sys term exit
  536.  
  537. *
  538. * decst
  539. *
  540. * Convert the number in D into an ascii string
  541. * representing a decimal number.  The string
  542. * is pointed at by X (X should be set on entry!)
  543. * Also on exit, D has the length of the string.
  544. * The second entry point, 'decstn' will not print
  545. * leading spaces for leading zeroes, but will
  546. * suppress all leading zero info.  All strings
  547. * start with a space.
  548. *
  549.  
  550. decst pshs x save user pointer
  551.  clr 0,-s set suppression flag
  552.  bra decst2
  553. *
  554. decstn pshs x save user pointer
  555.  clr 0,-s
  556.  inc 0,s set for no fielding
  557. decst2 pshs a
  558.  lda #$20 setup leading space
  559.  sta 0,x+ save in buffer
  560.  puls a
  561.  clr 0,-s set up bookkeeping
  562.  clr 0,-s
  563. decst3 ldy #conlst point to constants
  564. decst4 cmpd 0,y compare number to constant
  565.  blo decst5
  566.  subd 0,y do subtraction of constant
  567.  inc 1,s bump digits counter
  568.  bra decst4
  569. decst5 pshs a save number
  570.  tst 2,s zero digit?
  571.  bne decst6
  572.  tst 1,s any numbers output yet?
  573.  bne decst6
  574.  tst 3,s doing suppression?
  575.  bne decst8
  576.  lda #$20 set up space
  577.  bra decst7
  578. decst6 lda 2,s get digit count
  579.  inc 1,s set 'got one' flag
  580.  ora #$30 make ascii
  581. decst7 sta 0,x+ save in buffer
  582. decst8 puls a reset number
  583.  clr 1,s clear out digit
  584.  leay 2,y bump constant ptr
  585.  cmpy #conend end of list?
  586.  bne decst4
  587.  leas 3,s clean up stack
  588.  orb #$30 make last digit
  589.  stb 0,x+ save in buffer
  590.  clr 0,x null terminate string
  591.  tfr x,d
  592.  subd 0,s calculate string length
  593.  puls x,pc return
  594.  
  595.  pag
  596.  
  597. *
  598. * build new free list
  599. *
  600.  
  601. dobld ldd mbcnt get missing block count
  602.  addd #1
  603.  std mbcnt
  604.  addd #1
  605.  std r0 set up divide
  606.  ldb #100 by 100
  607.  stb r1
  608.  jsr div go divide
  609.  ldx #bm-1 init pointers
  610.  stx mpptr
  611.  clr btptr
  612.  clr btptr2
  613.  ldb work get divide remainder
  614.  stb incnt this is in core block count
  615.  jsr incor make in core list
  616.  jsr bldfc build free chain
  617.  rts return
  618.  
  619. *
  620. * divide
  621. *
  622.  
  623. div lda #17 set count
  624.  clrb set up countes
  625.  stb work
  626.  bra div2
  627. div1 ldb work
  628.  subb r1
  629.  bcs div2
  630.  stb work
  631. div2 rol r0+1
  632.  rol r0
  633.  rol work
  634.  deca
  635.  bne div1
  636.  com r0 fix result
  637.  com r0+1
  638.  lsr work fix remainder
  639.  rts return
  640.  
  641. *
  642. * Build in core list
  643. *
  644.  
  645. incor ldd dfd get file desc
  646.  sys seek,0,512,0 get sir ************** (1) *****************
  647.  lbes fch8
  648.  ldd dfd
  649.  sys read,bbuf,512 read in sir
  650.  lbes fch8 error?
  651.  ldx #bbuf+190 point to in core list
  652.  ldb #100 set counter
  653. incor2 clr 0,x+ zero list
  654.  clr 0,x+
  655.  clr 0,x+
  656.  decb
  657.  bne incor2
  658.  ldd mbcnt get count
  659.  std bbuf+$16 free count
  660.  clr bbuf+$15
  661.  ldx #bbuf point to sir
  662.  ldb incnt get incore block count
  663.  bne incor3 must be non-zero!!!!
  664.  swi
  665. incor3 leax 189,x
  666.  stb 0,x+
  667.  lda #3 set ptr
  668.  decb
  669.  mul
  670.  leax d,x point to end of list
  671. incor4 jsr getblk get a block
  672.  bne incor5 any left?
  673.  swi
  674. incor5 std 1,x save in list
  675.  leax -3,x
  676.  dec incnt dec the count
  677.  bne incor4
  678.  std fchbl save link block
  679.  ldd #1 set block count
  680.  jsr wrblk
  681.  rts return
  682.  
  683. *
  684. * build free chain
  685. *
  686.  
  687. bldfc ldx #bbuf zero buffer
  688.  clr 0,-s
  689.  ldd #0
  690. bldfc2 std 0,x++
  691.  dec 0,s
  692.  bne bldfc2
  693.  puls a fix stack
  694.  ldx #bbuf+297 point to end of list
  695. bldfc4 jsr getblk get a block
  696.  beq bldfc5
  697.  std 1,x save block in list
  698.  leax -3,x
  699.  cmpx #bbuf last one?
  700.  bhs bldfc4
  701.  ldu 4,x get link block
  702.  ldd fchbl
  703.  stu fchbl save new one
  704.  jsr wrblk write block
  705.  ldd r0 dec count
  706.  subd #1
  707.  std r0
  708.  bne bldfc
  709.  swi error!
  710. bldfc5 cmpx #bbuf start of list?
  711.  beq bldfc6
  712.  swi error!
  713. bldfc6 ldd fchbl get link block
  714.  jsr wrblk write it
  715.  rts return
  716.  
  717. *
  718. * wrblk
  719. *
  720.  
  721. *wrblk ldx #xxxx
  722. * jsr npms
  723. * rts
  724. wrblk jsr dfsk do seek
  725.  sys write,bbuf,512 write buffer
  726.  lbes fch8
  727.  rts return
  728.  
  729. *
  730. * get next free block
  731. *
  732.  
  733. getblk ldd mbcnt get free count
  734.  beq getbl7 no more?
  735.  pshs x save x
  736. getbl1 ldx mpptr get map ptr
  737.  lda lstusd get last byte value
  738.  ldb btptr in process?
  739.  bne getbl4
  740. getbl3 leax 1,x move to next guy
  741.  lda 0,x get byte
  742.  cmpa #$ff any here?
  743.  beq getbl3
  744.  stx mpptr save map ptr
  745.  ldb #8 init counters
  746.  stb btptr
  747.  clr btptr2
  748. getbl4 rola calc block number
  749.  bcs getbl6
  750.  sta lstusd
  751.  ldd mpptr
  752.  subd #bm
  753.  aslb
  754.  rola
  755.  aslb
  756.  rola
  757.  aslb
  758.  rola
  759.  orb btptr2
  760.  inc btptr2
  761.  dec btptr
  762.  pshs d save block number
  763.  ldd mbcnt dec free count
  764.  subd #1
  765.  std mbcnt
  766.  puls d,x reset regs
  767.  clz set status
  768.  rts return
  769. getbl6 inc btptr2
  770.  dec btptr
  771.  bne getbl4
  772.  bra getbl1
  773. getbl7 ldd #0 return 0 status
  774.  rts return
  775.  
  776. * constants for convert
  777.  
  778. conlst fdb 10000
  779.  fdb 1000
  780.  fdb 100
  781.  fdb 10
  782. conend equ * end of list
  783.  
  784. bdlne fcc 'Bad link in free list - check aborted.',$d,0
  785. drdms fcc 'Disk read error - check aborted.',$d,0
  786. xxxx fcc ' - chain block.',$d,0
  787.  
  788. BMSZ equ 1024*8-512 bit map size
  789.  
  790. isk fcb seek
  791. isk2 fcb 0
  792. isk3 fdb 0
  793.  fcb 0,0,0
  794.  
  795. iwrt fcb write
  796. iwrt2 fdb 0
  797. iwrt3 fdb 0
  798.  
  799. iopn fcb open
  800. iopn2 fdb 0,2
  801.  
  802. dfd rmb 2 file desc
  803. fdcnt rmb 2 fdn block count
  804. vlcnt rmb 2 volume block count
  805. frbl rmb 2 first free block count
  806. fbc rmb 2 free block count
  807. oorfb rmb 2 out of range count (free list)
  808. dupbc rmb 2 dup block count (free list)
  809. ffdc rmb 2 free fdn count
  810. ufdc rmb 2 used fdn count
  811. dir rmb 1 dir mode flag
  812. tin rmb 1 triple mode
  813. din rmb 1 double mode
  814. sin rmb 1 single mode
  815. rbflg rmb 1 reg block flag
  816. bfc rmb 2 block file count
  817. cfc rmb 2 character file count
  818. dfc rmb 2 dir file count
  819. rfc rmb 2 reg file count
  820. sindc rmb 2 single ind block count
  821. dindc rmb 2 double ind block count
  822. tindc rmb 2 triple ind block count
  823. dirbc rmb 2 dir file block count
  824. rgfbc rmb 2 reg file block count
  825. dupfc rmb 2 dup blocks in files count
  826. mbcnt rmb 2 missing block count
  827. oorflb rmb 2 out of range file blocks
  828. r0 fdb 0
  829. r1 fcb 0
  830. work fcb 0
  831. incnt fdb 0
  832. fchbl fdb 0
  833. mpptr fdb 0
  834. btptr fcb 0
  835. btptr2 fcb 0
  836. lstusd fcb 0
  837.  
  838. stbf rmb 16 string buffer
  839.  
  840. zzzzz equ *
  841.  
  842.  org $800
  843.  
  844. fdbuf rmb 512
  845. dbuf rmb 512
  846. tbuf rmb 512
  847. sir rmb 512
  848.  
  849. bbuf rmb 512
  850.  
  851. bm rmb BMSZ
  852.  
  853.  end fch
  854.