home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / lambda / soundpot / p / sf12.lbr / SF12.DZC / SF12.DOC
Encoding:
Text File  |  1993-10-25  |  9.5 KB  |  239 lines

  1.  
  2.  -----------------------------------------------------------------
  3.  
  4.             SF   .. a Show File program for CP/M systems
  5.  
  6.  ------------------------------------------------------------------
  7.                                  By
  8.  
  9.          John Gill,  Rt 5,  Box 370,  Blountville, TN 37617
  10.                        Telephone 615-323-2453
  11.  
  12.                           January 25, 1984
  13.  
  14.  
  15. Version 1.1  -  March 18, 1984
  16.    Fixed bug in displaying line numbers on lines with imbedded tabs.
  17.    Add selectable line number toggle.
  18.  
  19. Version 1.2  -  September 11, 1984
  20.    Corrected bug in ADD$HL routine.
  21.    Added End of File messages in Find and Move Forward commands.
  22.  
  23.  
  24.  
  25. NOTE:
  26.     The program "SF" is written in ZILOG Z-80 assembler code and will
  27. only run on a Z-80 with CP/M 2.2 or greater.
  28.               -------------------
  29.   ╔á havσ decideΣ t∩ makσ thσ sourcσ codσ availablσ s∩á tha⌠á other≤ ì
  30. ma∙ adap⌠ i⌠ easil∙ t∩ thei≥ systems« Permissioε i≤ granteΣ t∩  cop∙ ì
  31. o≥á distributσá thσá prograφ fo≥á non-commercia∞á usσá only«á Pleasσ ì
  32. contrac⌠á mσ iµ an∙ commercia∞ usσ oµ thσ prograφ i≤ desireΣ o≥á thσ ì
  33. use≥ make≤ an∙ significan⌠ improvement≤ iε thσ prograφ o≥ it≤ logic.
  34.  
  35.  
  36.    S╞ i≤ ß CP/═ utilit∙ t∩ SHO╫ thσ content≤ oµ ß ASCI╔ tex⌠ filσ oε ì
  37. disk« I⌠ ha≤ severa∞ feature≤ tha⌠ makσ i⌠ mucΦ morσ usefu∞ thaε thσ ì
  38. standarΣ inquir∙ utilitie≤ sucΦ a≤ "TYPE17ó anΣ CP/═ "TYPE".
  39.  
  40.  
  41. Features and restrictions:
  42. --------------------------
  43.  
  44.     1. Displays the file with or without preceding line numbers.
  45.  
  46.     2. Allows you to move through the file in a forward or backward
  47.        manor by a line-act-a-time, a page-at-a-time, a line increment,
  48.        or to go to any absolute line number.
  49.  
  50.     3. Allows the user to switch from page-by-page mode to continuous
  51.        scrolling display at any point in the program.
  52.  
  53.     4. Allows you to search for a string in the file and have the
  54.        screen display the page where the string is found.
  55. .pa
  56. è   
  57.  
  58.  
  59.  
  60.  
  61. COMMAND FORMAT:
  62. --------------
  63.  
  64.     Sho≈á Filσá i≤ ruε iε thσ samσ wa∙ a≤ a≤ thσ CP/═ utilit∙á TYPE« ì
  65.     Therσ i≤ onσ optional parameter that controls the addition of 
  66.     line numbers to the display.
  67.  
  68.     For example:
  69.  
  70.        SF MYPROG.ASM     displays the file without line numbers.
  71.  
  72.        SF MYPROG.Z80 N   displays the file with line numbers
  73.                          inserted in the front of each line.
  74.  
  75.  
  76.   INTERNAL COMMANDS
  77.   -----------------
  78.  
  79. Oncσ S╞ i≤ loaded¼á thσ prograφ open≤ thσ tex⌠ filσ anΣ display≤ thσ ì
  80. firs⌠á pagσá oµ 2│ lines«á Thσ curse≥ i≤ theε a⌠ thσ bottoφá oµá thσ ì
  81. screeε waitinτ fo≥  you≥ nex⌠ command«á Thσ bel∞ wil∞ bσ runτ iµá aε ì
  82. invaliΣ ke∙ strokσ i≤ made« Allowablσ command≤ are:
  83.  
  84. Single character commands:
  85.     These commands take effect as soon as they are entered.
  86.     No carriage return is required or expected.
  87.  
  88.     N    Toggles the line number function.
  89.          This allows the user to start without line numbers and switch
  90.          to line numbering as desired.
  91.  
  92.   Ctl-R  Moves the display window 1 page toward the front of the file.
  93.  
  94.   Ctl-C  Moves the display window 1 page toward the end of the file.
  95.          (The space bar and return key also perform this function).
  96.  
  97.   Ctl-E  Moves the window down 1 line and inserts a new line at the
  98.          top of the screen. The entire screen is actually re-written.
  99.  
  100.   Ctl-X  Scrolls the entire screen up one line and adds a new line
  101.          at the bottom of the screen.
  102.  
  103.   Ctl-S  Causes the program to switch from page-by-page mode to that
  104.          of continuous scrolling. Pressing any key, while the screen
  105.          is scrolling, will put the system back in command mode.
  106.  
  107.   Ctl-K  Exit Show File and return to CP/M. 
  108.  
  109. .pa
  110. è
  111.  
  112.   Note║á Thσ contro∞ codes¼ listeΣ above¼ follo≈ thσ WordSta≥ forma⌠ ì
  113. fo≥á curse≥ movement«á M∙ owε systeφ make≤ usσ oµ thσá Functioεá anΣ ì
  114. arro≈á key≤ iε placσ oµ thσ contro∞ codes«á Thσ entr∙ oµ ß Control-├ ì
  115. terminate≤ thσ prograφ anΣ return≤ t∩ CP/M« Thσ code≤ arσ defineΣ a⌠ ì
  116. thσá beginninτ oµ thσ prograφ anΣ caε easil∙ bσ changeΣ t∩ fi⌠á you≥ ì
  117. termina∞ requirements.
  118.  
  119.  
  120.  
  121. Multiple character commands:
  122.  
  123.    These commands require a carriage return to terminate the input.
  124.    The backspace key erases the last input character. A control-U
  125.    will cause the command to  be erased so that a new command may
  126.    be entered. The value "nnnn" represents a 1 to 4 digit ASCII
  127.    line number.
  128.  
  129.   nnnn   Move directly to line number "nnnn". The contents of this
  130.          line will be display on the top line of the screen. See the
  131.          section below on out of range line numbers.
  132.  
  133.  +nnnn   Move the screen window FORWARD "nnnn" lines in the file. 
  134.  
  135.  -nnnn   Similar to +nnnn, except the window is moved BACKWARD toward
  136.          the front of the file. 
  137.  
  138. Fstrinτ  Searche≤ froφ thσ "curren⌠ line"¼ forwarΣ iε thσ filσ unti∞ ì
  139.          it finds the string. The line where the string is found will
  140.          appear at the top of the screen. Note: if the "F" command
  141.          is entered without a string, it will use the previous string
  142.          if one is available. This allows repeated Finds without having
  143.          to re-enter the string each time.
  144.          The "current line" is defined as the last displayed line on
  145.          the screen. The second search will start at the end of this
  146.          last line.
  147.  
  148.  
  149. Out-of-range line numbers.
  150. --------------------------
  151.  
  152.          If end of file is encountered while moving through the file,
  153.          the program will clear the screen and be waiting for your
  154.          next command. The line counter will be positioned at the 
  155.          last line number in the file.
  156.          A command that would cause the line number to be positioned
  157.          before the front of the file, will be modified so that the
  158.          first page of the file is shown.
  159.  
  160.          The program displays only the portion of the line that will
  161.          fit the screen width. All characters beyond this limit will
  162.          not be displayed (no word wrap). They will be processed in
  163.          the Find command operation. When line numbers are requested,
  164.          thσ displayeΣ linσ widtΦái≤áreduceΣáb∙á╢ácharacte≥ positions.
  165. è
  166.    
  167.  
  168. A note on how the program operates.
  169. -----------------------------------
  170.  
  171.    Wheε displayinτ datß oε thσ CRT¼á al∞ taΓ character≤ arσ expandeΣ ì
  172. t∩á thσ standarΣ CP/═ positions« Tab≤ arσ no⌠ expandeΣ iε thσ "Findó ì
  173. command«á Al∞ contro∞ characters¼á othe≥ thaε Linσ Feed≤ o≥ Carriagσ ì
  174. Returns¼á arσ no⌠ sen⌠ t∩ thσ screen«á Thσ prograφ assume≤ eacΦ linσ ì
  175. ends with a Line Feed character.
  176.  
  177.    Sincσá tex⌠ file≤ arσ storeΣ a≤ ß collectioε oµá variablσá lengtΦ ì
  178. record≤á iεá ßá CP/═á system¼á therσ i≤ n∩ eas∙ wa∙ t∩á ge⌠á t∩á an∙ ì
  179. particula≥ record«á Onσ mus⌠ star⌠ a⌠ thσ beginning¼áo≥ somσá "knowε ì
  180. poin⌠" anΣá reaΣá forwarΣ sequentiall∙ unti∞ thσ desireΣá recorΣá i≤ ì
  181. reached«á Thi≤ prograφ build≤ ß tablσ oµ "knowε pointsó a≤ i⌠á read≤ ì
  182. forwarΣ iε thσ file. 
  183.  
  184.   Wheεá thσ use≥ request≤ ß linσ numbe≥ tha⌠ ha≤ no⌠ beeε previousl∙ ì
  185. processed¼á thσá compute≥ locate≤ thσ closes⌠ "knowε pointó tha⌠á i⌠ ì
  186. ha≤á anΣá theεá read≤ forward«á Thσ proces≤ i≤ mucΦá faste≥á iεá thσ ì
  187. backwarΣ movement¼á sincσ thσ compute≥ ha≤ alread∙ se⌠ thesσá "knowε ì
  188. pointsóá anΣ caε movσ t∩ thσ closes⌠ onσ iε ß fractioε oµ ßá second« ì
  189. Wheε yo⌡ start¼ yo⌡ arσ positioneΣ a⌠ thσ enΣ oµ thσ las⌠ linσ numbe≥ ì
  190. oε thσ CRT«á A⌠ tha⌠ time¼á iµ yo⌡ reques⌠ ß linσ tha⌠ i≤ a⌠ thσ enΣ ì
  191. oµá thσá file¼á thσ compute≥ ha≤ t∩ reaΣ forwarΣ througΦ thσá entirσ ì
  192. filσ beforσ i⌠ caε displa∙ thσ requesteΣ data.
  193.  
  194.   I⌠á ha≤ somewha⌠ oµ ß speeΣ advantagσ iε tha⌠ i⌠ doe≤ no⌠ havσá t∩ ì
  195. senΣá thσ datß t∩ thσ CR╘ unti∞ i⌠ reache≤ thσ requesteΣá line«á Thσ ì
  196. prograφá keep≤á tracδ oµ thσ linσ number≤ tha⌠ g∩ witΦ thσá To≡á anΣ ì
  197. Bottoφá line≤á oε thσ screen«á Iµ yo⌡ reques⌠ forwarΣ linσá movemen⌠ ì
  198. tha⌠ i≤ les≤ thaε ß ful∞ screen¼á thσ prograφ wil∞ scrol∞ thσ screeε ì
  199. rathe≥ thaε rewritσ thσ entirσ screen« An∙ backwarΣ movemen⌠ (towarΣ ì
  200. the front of the file) will cause the entire screen to be rewritten.
  201.  
  202.   Thσá prograφ doe≤ n∩ interna∞ datß blocking«á I⌠ operate≤ witΦ thσ ì
  203. standarΣ 12╕ bytσ record« Sincσ man∙ user≤ havσ ß Deblockinτ BIOS¼ ╔ ì
  204. fee∞á tha⌠ ver∙ littlσ speeΣ gaiε woulΣ resul⌠ froφ interna∞á recorΣ ì
  205. blocking«á Thσ logiπ useΣ t∩ kee≡ tracδ oµ thσ "knowε pointsóá coulΣ ì
  206. bσá ß lo⌠ morσ complicateΣ thaε i⌠ currentl∙ i≤ (anΣ it≤ baΣá enougΦ ì
  207. a≤ i⌠ is).
  208.  
  209.   Thσá prograφá occupie≤ abou⌠ 170░ byte≤ oµ memory«á I⌠á als∩á use≤ ì
  210. anothe≥á 40░ byte≤ fo≥ tablσ area«á Al∞ consolσ input/outpu⌠ i≤ donσ ì
  211. directl∙á througΦ thσ BIOS«á Thi≤ prevent≤ an∙ oµ thσá CP/═á contro∞ ì
  212. function≤á froφá havinτ an∙ effec⌠ oε prograφá operation«á Thσá disδ ì
  213. operation≤ arσ al∞ processeΣ usinτ thσ standarΣ CP/═ BDO╙ calls.
  214.  
  215. .pa
  216. è
  217.  
  218.  
  219. A note on re-assembling the program.
  220. ------------------------------------
  221.  
  222.    Thσ prograφ wa≤ writteε iε Ziloτ Z-8░ mnemonics«á ╔ personall∙ d∩ ì
  223. no⌠á likσ thσ extendeΣ Inte∞ mnemonics«á Thσ Ziloτ mnemonic≤ makσá ß ì
  224. lot more sense to me.
  225.  
  226.   ╔á useΣ aε Cromemc∩ assemble≥ versioε 3.0╖ t∩ assemblσ thσá sourcσ ì
  227. oεá aε S-10░ bu≤ CP/═ system«á Thσ Cromemc∩ assemble≥ recognize≤ thσ ì
  228. firs⌠ eigh⌠ character≤ oµ variablσ name≤ anΣ labels«á Severa∞ oµá m∙ ì
  229. name≤ anΣ label≤ havσ exceedeΣ thi≤ limit¼ bu⌠ the∙ causσ n∩ probleφ ì
  230. since the first eight characters are unique.
  231.  
  232.   Thσ Cromemc∩ assemble≥ produce≤ ß HE╪ filσ tha⌠ i≤ compatablσ witΦ ì
  233. the CP/M LOAD command. It also can produce a REL file also.
  234.  
  235.  
  236.  
  237.  
  238.    One Last word:
  239.      If you have any problems or suggestions concerning this program,
  240.      please let me know about them.
  241.  
  242.  
  243.