home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PROGRAMS / UTILS / LASER / PSU.ZIP / PSU.DOC < prev    next >
Encoding:
Text File  |  1986-04-18  |  9.8 KB  |  265 lines

  1.  
  2.  
  3.                                     PSU
  4.                            Printer Setup Utility
  5.  
  6.                                 Tom Peters
  7.  
  8. This document describes PSU, Versions 1.0, 1.1, and 1.2.
  9.  
  10. Version  1.1  doubled the buffer size to 2048 bytes (0800h) and  version  1.2
  11. does a directory of *.PSU and lists any such file on the screen.
  12.  
  13. PSU IS NOT PUBLIC DOMAIN SOFTWARE! BUT:
  14.  
  15. PSU  may  be freely distributed PROVIDED
  16. 1. that all copyright notices are left intact, and that
  17. 2. it is distributed with all documentation and other files included, and that
  18. 3. no charge is made other that normal media costs (<$10).
  19. 4. all PSU datafiles (*.PSU) contain the copyright notice included with the
  20.    sample files,  either in the ID line or the test pattern.
  21.  
  22. The  easiest  way to implement item 4 above is to build  any  PSU
  23. files using the enclosed SAMPLE.PSU as its basis.
  24.  
  25. If  you find PSU usefull (I'm sure you will) please send a contribution  ($20
  26. suggested) to me. This will enable me to continue to write software.
  27.  
  28. Tom Peters, 2811 W. Green Tree, Glendale, WI  53209
  29.  
  30.                                   Using PSU
  31.  
  32. In order for PSU to work, you must be already able to talk to the printer. If
  33. it is a serial printer, you may need to issue a command like the ones below:
  34.  
  35. SETUP LPT1:=COM1
  36. SETUP COM1:baud,parity,databits,stopbits,P
  37.  
  38. Where baud, parity, databits, and stopbits are the values appropriate to your
  39. printer, and P is always specified. (P means "continuous retry on error").
  40.  
  41. Your computer may use a MODE command similar to the SETUP command; see your
  42. DOS manual.
  43.  
  44. Under Concurrent DOS or CP/M-86, you may need to issue the
  45. appropriate PRINTER n command, where n is the printer number you will be
  46. using.  Also  insure that your LPRS file is set up correctly;  the LPRS  file
  47. accomplishes the same task as the MODE or SETUP commands.
  48.  
  49.                                 PSU datafiles
  50.  
  51. PSU ignores case in filenames.  You may enter the name of a file in all caps,
  52. all lowercase, or any combination.
  53.  
  54. Case IS significant in the menu,  though.  Items "c" and "C" may perhaps both
  55. appear, and they are different.
  56.  
  57. You  may have one or more PSU files on a drive.  They all end in .PSU and all
  58. have a similar structure.  PSU must be told which file to use,  which you can
  59. do in any of 3 ways.
  60.  
  61.  
  62.  
  63.  
  64.  
  65.                                 1
  66.  
  67.  
  68.  
  69. 1.  DEFAULT: Copy  the  PSU file you use most often  into  DEFAULT.PSU.  The
  70. command to do this would look something like that below:
  71.  
  72. A>COPY OKI192.PSU DEFAULT.PSU
  73.  
  74. If PSU can find DEFAULT.PSU,  and if you invoke PSU without any filename, PSU
  75. will  use the data in DEFAULT.PSU without further input from  you.  The  menu
  76. that appears in this case will tell you what printer the DEFAULT file assumes
  77. you have.  Henceforth, you could enter the command below to run PSU using the
  78. DEFUALT data:
  79.  
  80. A>PSU
  81.  
  82. 2.  SPECIFIED ON COMMAND LINE:  If you know that the file TALLY160.PSU exists
  83. on the current disk, you may specify that file on the command line:
  84.  
  85. A>PSU TALLY160
  86.      -or-
  87. C>PSU A:TALLY160
  88.  
  89. In this case, PSU will use the file TALLY160 without further input from you.
  90.  
  91. 3.  SPECIFIED AT PROMPT:  If DEFAULT.PSU is not available, or you type a name
  92. on  the command line that doesn't exist or has something wrong with  it,  PSU
  93. will prompt you for the name of the file you wish to use. PSU reports that it
  94. couldn't  find  DEFAULT.PSU.  It  then checks to see if any other  PSU  files
  95. exist, and lists any it finds, and asks you to enter one of them.
  96.  
  97. Note  that PSU doesn't understand paths under MS-DOS (tm).  PSU.EXE may exist
  98. in any directory or drive you have a path to,  but the datafiles (*.PSU) must
  99. be in the current directory.
  100.  
  101.                                   THE MENU
  102.  
  103. The menu consists of the FILE ID,  the MENU CHARACTERS, and the DESCRIPTIONS.
  104. The FILE ID appears at the top.  It just tells you what model(s) printer this
  105. file is appropriate for. 
  106.  
  107. The MENU CHARACTERS are single letters/numbers/symbols along the left edge of
  108. the menu. Below is a line from the middle of an average menu:
  109.  
  110. C Set compressed print (16 CPI)
  111.  
  112. The  menu character above is "C",  so entering C will cause Compressed  print
  113. (16  characters  per  inch) to be activated.  The DESCRIPTION  in  the  above
  114. example  is of course "Set compressed print (16 CPI)" and describes what  the
  115. function does.
  116.  
  117.                                   WHEN DONE
  118.  
  119. PSU always presents the option "(CR to quit)" at the bottom of the  menu.  CR
  120. is  shorthand for "Carriage Return" and means press the RETURN or ENTER  key.
  121. This  takes you out of PSU.  If you enter the PSU menu and see that the ID at
  122. the  top is for a printer other that the one you have,  press CR right  away,
  123. rather than confuse your printer with control codes it won't understand.
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.                                 2
  132.  
  133.  
  134.  
  135.                               TECHNICAL STUFF
  136.                               ===============
  137.  
  138.                          MAKING YOUR OWN PSU FILES
  139.  
  140. 1. The file is 2048 bytes long or less.
  141. 2. All data is plain ascii text. Case matters, BUT hex values may be upper or
  142.    lower case. All hex characters are TWO characters, lead zeros if required.
  143. 3. The high bit is not ignored, so if the PSU file was created in Wordstar's
  144.    Document mode it probably WON'T WORK. ***Fixed in version 1.2: Only menu
  145.    descriptions need have the hi-bit clear. Hex values will evaluate correctly.
  146. 4. Item 1 in the file is a label or identifier detailing printers applicable
  147.    and the last revision date of that particular PSU file. The label is ascii
  148.    text and ends with "$". Example:
  149. OKIDATA 192 & 193 PRINTERS revised 03/08/86
  150. $
  151.    Note  that  in  the above example,  there is an  extra  cr/lf  before  the
  152.    terminating   dollar-sign. If the menu gets to big for 1 screen, place the
  153.    "$" on the same line as the ID.
  154. 5. All remaining items are function entries, except the terminator entry.
  155. 6. A function entry consists of a backslash, the menu option letter, <SPACE>,
  156.    the function description, '$',hex codes, '$'. Example function entries:
  157.  
  158. \A 10 Characters/Inch$1E$
  159. \B 12 Characters/Inch$1C$
  160. \C 17 CPI$1D$
  161. \D Draft Quality mode$1B 30$
  162. \Q Correspondence Quality mode$1B 31$
  163. 7. The last item is a terminating entry:
  164. \$
  165.  
  166. The hex codes can be separated by any non-alphabetic character,  (except $ or
  167. \) or not separated at all. All of the examples below will work:
  168.  
  169. \T Short test pattern$41 42 43 44 45$
  170. \T Short test pattern$41,42,43,44,45$
  171. \T Short test pattern$41-42-43-44-45$
  172. \T Short test pattern$4142434445$
  173.  
  174. Example setup file:
  175.  
  176. OKIDATA 192 & 193 PRINTER SETUP FILE 03/08/86$
  177. \P Set 10 pitch$1E$
  178. \E Set 12 pitch$1C$
  179. \C Set 16 pitch$1D$
  180. \D Go to Draft  quality$1B 30 79$
  181. \L Go to Letter quality$1B 31 79$
  182. \H Start Enhanced   print$1B 48$
  183. \Z Start Emphasized print$1B 54$
  184. \C Cancel Emphasized AND Enhanced print$1B 49$
  185. \0 Skip no lines at bottom of page$1B 25 53 00$
  186. \4 Skip  4 lines at bottom of page (for performation)$1B 25 53 04$
  187. \Q Start Underlining$1B 43$
  188. \N Stop  Underlining$1B 44$
  189. \U Print Unidirectionaly (left-to-right only)$1B 2D$
  190. \B Print Bidirectionaly$1B 3D$
  191. \T Set top-of-form to current position$1B 35$
  192. \F Feed to top of next page$0C$
  193. \# Print a Test Pattern$41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E
  194. 4F 50 51 52 53 54 55 56 0D 0A$
  195.  
  196.  
  197.                                 3
  198.  
  199.  
  200.  
  201. \$
  202.  
  203. In the example above, there are too many lines to fit on one screen. One line
  204. is saved by making the Identifier Line one line instead of two. This is done
  205. by placing the terminating "$" on the same line.
  206.  
  207. Setup file names all end with .PSU and are 1-8 characters long. You should make
  208. the names as descriptive as possible. Some conventions to follow:
  209.  
  210. 1. Make the name a abbreviation of the make followed by the model number.
  211. 2. Name the file with the lowest common denominator model number. For example,
  212.    the control codes for the Okidata 192 printer apply the the 193 as well;
  213.    name the file OKI192.PSU
  214.  
  215. A few notes about the content of the file:
  216.  
  217. 1. Menu letters: Use all capital letters and minimize the use of symbols, if
  218.    possible.
  219. 2. Always include a test pattern.
  220. 3. If the file contains more than 2048 bytes (characters) of date, only the
  221.    first 2048 bytes will be read. If options near the end of the file don't
  222.    appear on the menu, the file may be too long.
  223. 4. It is often convenient to have \F Form feed$0C$ in the file.
  224.  
  225. PSU cares little about where carriage returns and linefeeds are.
  226. The only place you can't sprinkle them in is in the middle of a hex value.
  227.  
  228.                           PATCHING PSU
  229.  
  230. Those  of you who are adventurous and know how to use DEBUG can make a  few
  231. patches. The structure of the data area of PSU is shown below.
  232.  
  233.                    (The prompts and strings appear here)
  234.  
  235.           BUF_SIZE  EQU  0800h
  236. read_buf       db       BUF_SIZE dup (0) ; 2048 byte disk read buffer
  237. read_buf_end   db       0                ; address for the end of the buffer
  238. ; DEFAULT FCB- TRY TO OPEN IF NO DATA ON COMMAND LINE
  239. DEF_FCB         db      00      ; drive code: 0=default, 1=a:, 2=B:, 3=C:, 4=D:
  240. DFCB_NAME       DB      'DEFAULT '      ; FILENAME
  241. DFCB_TYPE       DB      'PSU'           ; FILETYPE
  242.  
  243. You  could,  for example,  patch the byte at DEF_FCB to 01 to force PSU  to
  244. always look on drive A: for DEFAULT.PSU rather than the default drive.
  245.  
  246. You  should not attempt to run any of the code in PSU if you are  going  to
  247. patch it.  PSU plays games with CS,  DS,  and ES, so you may not be able to
  248. find the data. Use the default DS that DOS gives you when debug is started.
  249.  
  250. Here is a list of approximate locations in the DS. The relationship between
  251. them shouldn't change, tho the adresses may.
  252.  
  253. 0000 PSP
  254. 0100 Stack
  255. 039E Strings
  256. 0A07 File read buffer
  257. 1208 Drive and Name of default PSU file
  258.  
  259.  
  260.  
  261.  
  262.  
  263.                                 4
  264.  
  265.