home *** CD-ROM | disk | FTP | other *** search
-
- -----------------------------------------------------------------
-
- SF .. a Show File program for CP/M systems
-
- ------------------------------------------------------------------
- By
-
- John Gill, Rt 5, Box 370, Blountville, TN 37617
- Telephone 615-323-2453
-
- January 25, 1984
-
-
- Version 1.1 - March 18, 1984
- Fixed bug in displaying line numbers on lines with imbedded tabs.
- Add selectable line number toggle.
-
- Version 1.2 - September 11, 1984
- Corrected bug in ADD$HL routine.
- Added End of File messages in Find and Move Forward commands.
-
-
-
- NOTE:
- The program "SF" is written in ZILOG Z-80 assembler code and will
- only run on a Z-80 with CP/M 2.2 or greater.
- -------------------
- ╔á havσ decideΣ t∩ makσ thσ sourcσ codσ availablσ s∩á tha⌠á other≤ ì
- ma∙ adap⌠ i⌠ easil∙ t∩ thei≥ systems« Permissioε i≤ granteΣ t∩ cop∙ ì
- o≥á distributσá thσá prograφ fo≥á non-commercia∞á usσá only«á Pleasσ ì
- contrac⌠á mσ iµ an∙ commercia∞ usσ oµ thσ prograφ i≤ desireΣ o≥á thσ ì
- use≥ make≤ an∙ significan⌠ improvement≤ iε thσ prograφ o≥ it≤ logic.
-
-
- S╞ i≤ ß CP/═ utilit∙ t∩ SHO╫ thσ content≤ oµ ß ASCI╔ tex⌠ filσ oε ì
- disk« I⌠ ha≤ severa∞ feature≤ tha⌠ makσ i⌠ mucΦ morσ usefu∞ thaε thσ ì
- standarΣ inquir∙ utilitie≤ sucΦ a≤ "TYPE17ó anΣ CP/═ "TYPE".
-
-
- Features and restrictions:
- --------------------------
-
- 1. Displays the file with or without preceding line numbers.
-
- 2. Allows you to move through the file in a forward or backward
- manor by a line-act-a-time, a page-at-a-time, a line increment,
- or to go to any absolute line number.
-
- 3. Allows the user to switch from page-by-page mode to continuous
- scrolling display at any point in the program.
-
- 4. Allows you to search for a string in the file and have the
- screen display the page where the string is found.
- .pa
- è
-
-
-
-
- COMMAND FORMAT:
- --------------
-
- Sho≈á Filσá i≤ ruε iε thσ samσ wa∙ a≤ a≤ thσ CP/═ utilit∙á TYPE« ì
- Therσ i≤ onσ optional parameter that controls the addition of
- line numbers to the display.
-
- For example:
-
- SF MYPROG.ASM displays the file without line numbers.
-
- SF MYPROG.Z80 N displays the file with line numbers
- inserted in the front of each line.
-
-
- INTERNAL COMMANDS
- -----------------
-
- Oncσ S╞ i≤ loaded¼á thσ prograφ open≤ thσ tex⌠ filσ anΣ display≤ thσ ì
- firs⌠á pagσá oµ 2│ lines«á Thσ curse≥ i≤ theε a⌠ thσ bottoφá oµá thσ ì
- screeε waitinτ fo≥ you≥ nex⌠ command«á Thσ bel∞ wil∞ bσ runτ iµá aε ì
- invaliΣ ke∙ strokσ i≤ made« Allowablσ command≤ are:
-
- Single character commands:
- These commands take effect as soon as they are entered.
- No carriage return is required or expected.
-
- N Toggles the line number function.
- This allows the user to start without line numbers and switch
- to line numbering as desired.
-
- Ctl-R Moves the display window 1 page toward the front of the file.
-
- Ctl-C Moves the display window 1 page toward the end of the file.
- (The space bar and return key also perform this function).
-
- Ctl-E Moves the window down 1 line and inserts a new line at the
- top of the screen. The entire screen is actually re-written.
-
- Ctl-X Scrolls the entire screen up one line and adds a new line
- at the bottom of the screen.
-
- Ctl-S Causes the program to switch from page-by-page mode to that
- of continuous scrolling. Pressing any key, while the screen
- is scrolling, will put the system back in command mode.
-
- Ctl-K Exit Show File and return to CP/M.
-
- .pa
- è
-
- Note║á Thσ contro∞ codes¼ listeΣ above¼ follo≈ thσ WordSta≥ forma⌠ ì
- fo≥á curse≥ movement«á M∙ owε systeφ make≤ usσ oµ thσá Functioεá anΣ ì
- arro≈á key≤ iε placσ oµ thσ contro∞ codes«á Thσ entr∙ oµ ß Control-├ ì
- terminate≤ thσ prograφ anΣ return≤ t∩ CP/M« Thσ code≤ arσ defineΣ a⌠ ì
- thσá beginninτ oµ thσ prograφ anΣ caε easil∙ bσ changeΣ t∩ fi⌠á you≥ ì
- termina∞ requirements.
-
-
-
- Multiple character commands:
-
- These commands require a carriage return to terminate the input.
- The backspace key erases the last input character. A control-U
- will cause the command to be erased so that a new command may
- be entered. The value "nnnn" represents a 1 to 4 digit ASCII
- line number.
-
- nnnn Move directly to line number "nnnn". The contents of this
- line will be display on the top line of the screen. See the
- section below on out of range line numbers.
-
- +nnnn Move the screen window FORWARD "nnnn" lines in the file.
-
- -nnnn Similar to +nnnn, except the window is moved BACKWARD toward
- the front of the file.
-
- Fstrinτ Searche≤ froφ thσ "curren⌠ line"¼ forwarΣ iε thσ filσ unti∞ ì
- it finds the string. The line where the string is found will
- appear at the top of the screen. Note: if the "F" command
- is entered without a string, it will use the previous string
- if one is available. This allows repeated Finds without having
- to re-enter the string each time.
- The "current line" is defined as the last displayed line on
- the screen. The second search will start at the end of this
- last line.
-
-
- Out-of-range line numbers.
- --------------------------
-
- If end of file is encountered while moving through the file,
- the program will clear the screen and be waiting for your
- next command. The line counter will be positioned at the
- last line number in the file.
- A command that would cause the line number to be positioned
- before the front of the file, will be modified so that the
- first page of the file is shown.
-
- The program displays only the portion of the line that will
- fit the screen width. All characters beyond this limit will
- not be displayed (no word wrap). They will be processed in
- the Find command operation. When line numbers are requested,
- thσ displayeΣ linσ widtΦái≤áreduceΣáb∙á╢ácharacte≥ positions.
- è
-
-
- A note on how the program operates.
- -----------------------------------
-
- Wheε displayinτ datß oε thσ CRT¼á al∞ taΓ character≤ arσ expandeΣ ì
- t∩á thσ standarΣ CP/═ positions« Tab≤ arσ no⌠ expandeΣ iε thσ "Findó ì
- command«á Al∞ contro∞ characters¼á othe≥ thaε Linσ Feed≤ o≥ Carriagσ ì
- Returns¼á arσ no⌠ sen⌠ t∩ thσ screen«á Thσ prograφ assume≤ eacΦ linσ ì
- ends with a Line Feed character.
-
- Sincσá tex⌠ file≤ arσ storeΣ a≤ ß collectioε oµá variablσá lengtΦ ì
- record≤á iεá ßá CP/═á system¼á therσ i≤ n∩ eas∙ wa∙ t∩á ge⌠á t∩á an∙ ì
- particula≥ record«á Onσ mus⌠ star⌠ a⌠ thσ beginning¼áo≥ somσá "knowε ì
- poin⌠" anΣá reaΣá forwarΣ sequentiall∙ unti∞ thσ desireΣá recorΣá i≤ ì
- reached«á Thi≤ prograφ build≤ ß tablσ oµ "knowε pointsó a≤ i⌠á read≤ ì
- forwarΣ iε thσ file.
-
- Wheεá thσ use≥ request≤ ß linσ numbe≥ tha⌠ ha≤ no⌠ beeε previousl∙ ì
- processed¼á thσá compute≥ locate≤ thσ closes⌠ "knowε pointó tha⌠á i⌠ ì
- ha≤á anΣá theεá read≤ forward«á Thσ proces≤ i≤ mucΦá faste≥á iεá thσ ì
- backwarΣ movement¼á sincσ thσ compute≥ ha≤ alread∙ se⌠ thesσá "knowε ì
- pointsóá anΣ caε movσ t∩ thσ closes⌠ onσ iε ß fractioε oµ ßá second« ì
- Wheε yo⌡ start¼ yo⌡ arσ positioneΣ a⌠ thσ enΣ oµ thσ las⌠ linσ numbe≥ ì
- oε thσ CRT«á A⌠ tha⌠ time¼á iµ yo⌡ reques⌠ ß linσ tha⌠ i≤ a⌠ thσ enΣ ì
- oµá thσá file¼á thσ compute≥ ha≤ t∩ reaΣ forwarΣ througΦ thσá entirσ ì
- filσ beforσ i⌠ caε displa∙ thσ requesteΣ data.
-
- I⌠á ha≤ somewha⌠ oµ ß speeΣ advantagσ iε tha⌠ i⌠ doe≤ no⌠ havσá t∩ ì
- senΣá thσ datß t∩ thσ CR╘ unti∞ i⌠ reache≤ thσ requesteΣá line«á Thσ ì
- prograφá keep≤á tracδ oµ thσ linσ number≤ tha⌠ g∩ witΦ thσá To≡á anΣ ì
- Bottoφá line≤á oε thσ screen«á Iµ yo⌡ reques⌠ forwarΣ linσá movemen⌠ ì
- tha⌠ i≤ les≤ thaε ß ful∞ screen¼á thσ prograφ wil∞ scrol∞ thσ screeε ì
- rathe≥ thaε rewritσ thσ entirσ screen« An∙ backwarΣ movemen⌠ (towarΣ ì
- the front of the file) will cause the entire screen to be rewritten.
-
- Thσá prograφ doe≤ n∩ interna∞ datß blocking«á I⌠ operate≤ witΦ thσ ì
- standarΣ 12╕ bytσ record« Sincσ man∙ user≤ havσ ß Deblockinτ BIOS¼ ╔ ì
- fee∞á tha⌠ ver∙ littlσ speeΣ gaiε woulΣ resul⌠ froφ interna∞á recorΣ ì
- blocking«á Thσ logiπ useΣ t∩ kee≡ tracδ oµ thσ "knowε pointsóá coulΣ ì
- bσá ß lo⌠ morσ complicateΣ thaε i⌠ currentl∙ i≤ (anΣ it≤ baΣá enougΦ ì
- a≤ i⌠ is).
-
- Thσá prograφá occupie≤ abou⌠ 170░ byte≤ oµ memory«á I⌠á als∩á use≤ ì
- anothe≥á 40░ byte≤ fo≥ tablσ area«á Al∞ consolσ input/outpu⌠ i≤ donσ ì
- directl∙á througΦ thσ BIOS«á Thi≤ prevent≤ an∙ oµ thσá CP/═á contro∞ ì
- function≤á froφá havinτ an∙ effec⌠ oε prograφá operation«á Thσá disδ ì
- operation≤ arσ al∞ processeΣ usinτ thσ standarΣ CP/═ BDO╙ calls.
-
- .pa
- è
-
-
- A note on re-assembling the program.
- ------------------------------------
-
- Thσ prograφ wa≤ writteε iε Ziloτ Z-8░ mnemonics«á ╔ personall∙ d∩ ì
- no⌠á likσ thσ extendeΣ Inte∞ mnemonics«á Thσ Ziloτ mnemonic≤ makσá ß ì
- lot more sense to me.
-
- ╔á useΣ aε Cromemc∩ assemble≥ versioε 3.0╖ t∩ assemblσ thσá sourcσ ì
- oεá aε S-10░ bu≤ CP/═ system«á Thσ Cromemc∩ assemble≥ recognize≤ thσ ì
- firs⌠ eigh⌠ character≤ oµ variablσ name≤ anΣ labels«á Severa∞ oµá m∙ ì
- name≤ anΣ label≤ havσ exceedeΣ thi≤ limit¼ bu⌠ the∙ causσ n∩ probleφ ì
- since the first eight characters are unique.
-
- Thσ Cromemc∩ assemble≥ produce≤ ß HE╪ filσ tha⌠ i≤ compatablσ witΦ ì
- the CP/M LOAD command. It also can produce a REL file also.
-
-
-
-
- One Last word:
- If you have any problems or suggestions concerning this program,
- please let me know about them.
-
-
-