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