home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PROGRAMS / UTILS / NOVELL / COM281.ZIP / COMM281.DOC next >
Encoding:
Text File  |  1990-06-20  |  14.4 KB  |  276 lines

  1. COMMENT
  2. (c) 1987, 1988, 1989, 1990 Galapagos Development and Scott Wenzel
  3. 772 Crescent Street, Buffalo, NY  14216
  4. ┌─────────────────────────────────────────────────────────────────────────────┐
  5. │                                                                             │
  6. │                          Look for these upcoming new                        │
  7. │                          items, toys and innovations                        │
  8. │                          from Galapagos Development:                        │
  9. │                                                                             │
  10. │                 -  AIRPLANE TOILET(tm) - the oddest game you ever saw       │
  11. │                 -  POSTpaid(tm) - to format files to print on PS devices    │
  12. │                 -  COMMRES - memory-resident popup version of COMMENT       │
  13. │                                                                             │
  14. │~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~│
  15. │  Register now!  Register now!  Register now!  Register now!  Register now!  │
  16. │                                                                             │
  17. └─────────────────────────────────────────────────────────────────────────────┘
  18. Register your copy of this program by sending me your name, address, the
  19. version number you are using (displayable by invoking COMMENT ?), and
  20. $6.00 in US money, and I will see that you get at least two future updates
  21. of COMMENT.COM and my hearty thanks.
  22.  
  23. As a greater incentive, anyone registering with $15 or more will get:
  24. -  source code (which you want because then you can change the quotes)
  25. -  a printed copy of the current docs which includes the ASM source code frame
  26. -  even heartier thanks.
  27.  
  28. In addition, registrants will be able to get future fun quasi-commercial
  29. versions of COMMENT at greatly reduced cost.
  30.  
  31. Speaking of commercials, let me say that starting with Version 2.61, all copies
  32. of COMMENT contain a "commercial" that comes up now and then in spectacular
  33. fashion to encourage you to register and get all sorts of goodies like these.
  34.  
  35. By the way, let me know WHERE you got this copy of COMMENT.  I always
  36. like to see the information supply lines at work.  It's an odd feeling dialing
  37. into a new BBS and finding your own program got there before you did.
  38.  
  39.  
  40. VERSION HISTORY -- COMMENT.ASM
  41.  
  42. Version 1.00 04/15/87  --  original version with 20 quotes
  43. Version 1.40 06/01/87  --  expanded to 75 quotes
  44. Version 1.90 09/15/87  --  expanded to 100 quotes
  45. Version 2.09 05/30/88  --  reworked algorithm to include blocks and pointers
  46. Version 2.10 12/15/88  --  expanded to 115 quotes
  47. Version 2.11 06/01/89  --  expanded to 123 quotes, added separator lines
  48. Version 2.12 07/26/89  --  expanded to 125 quotes, corrected some items
  49. Version 2.13 08/17/89  --  changed about a dozen quotes and updated others
  50. Version 2.20 10/17/89  --  made formatting consistent, began use of ANSI codes
  51. Version 2.30 10/23/89  --  expanded to 160 quotes
  52. Version 2.31 11/21/89  --  expanded to 169 quotes and added command-line parms
  53. Version 2.41 12/22/89  --  expanded to 205 quotes, rewrote subroutine calls for clarity
  54. Version 2.50 12/23/89  --  added "dump" mode to spit out all messages for diagnostic uses
  55. Version 2.55 01/07/90  --  expanded to 285 quotes -- went from 5 to 7 mblocks
  56. Version 2.61 01/31/90  --  added X option to enable off-color comments, (also 
  57.                            known as "wiener mode," added more stuff, fixed bug
  58.                            in dump mode that prevented display of first item 
  59.                            and caused crap at end of dump
  60. Version 2.70 04/09/90  --  added checking for ANSI driver loaded
  61. Version 2.80 06/05/90  --  expanded to 325 quotes, added pause option and timed
  62.                            wait-after-display option
  63. Version 2.81 06/19/90  --  more material, fixed wait mode to be CPU-speed
  64.                            independent
  65. -----------------------------------------------------------------------------
  66. VERSION HISTORY -- COMMRES.ASM
  67.  
  68. Version 0.01 12/12/89  --  Testing version; problems with segment pointers -- not operable
  69. Version 0.10 12/14/89  --  Testing version; still pointer problems but does install correctly
  70. Version 0.25 01/04/90  --  Testing version; working out way to do windowing
  71. Version 0.30 04/01/90  --  Miserable failure; project on hold
  72. -----------------------------------------------------------------------------
  73. COMMENT.ASM and COMMENT.COM Version 2.0 - 3.0+
  74. COMMRES.ASM and COMMRES.COM Version 0.01 - 1.0+
  75.  
  76. (c) Copyright 1987, 1988, 1989, 1990  Scott Wenzel
  77. Commercial redistribution prohibited
  78. No fee may be charged for distribution of any portion of this code or any
  79. executable program or derivative created from any portion of this code.
  80. NOTE!
  81. NOTE!
  82. NOTE!
  83.  
  84. This file was created and modified using Eric Isaacson's A86 shareware
  85. assembler, an item I highly recommend.  If, however, you wanna be asinine
  86. and use MASM, you will have to install all the ASSUMES and SEGMENT and ENDS
  87. statements and other such junk.  Eric's A86 allows you to have done with all
  88. that and simply write clean code.  This program is loosely based on a routine
  89. done some years ago called CAVEAT, but all the quotes have been rewritten and
  90. the indexing routine expanded greatly beyond the old version's practical limit
  91. of 100 messages or so, beyond which some of them seemed to never be displayed.
  92. Since the new routine uses the seconds' AND hundredths' timer of the DOS clock
  93. in a dual-indexing scheme in order to come up with its pseudo-random choice
  94. of quotes, any of you geniuses can go ahead and tweak it to read the date
  95. or something or factor in the month or whatever and thus be able to have
  96. (theoretically) thousands of quotes in here (see your Assembly Language
  97. manual under the heading of "Memory Segment Limits."  See also "65,535")
  98. Go ahead and modify it all you want, but leave some of the quotes in, and
  99. also leave all this stuff in so we can keep some kind of revision history
  100. and therefore not reinvent the wheel.  Leave a few of the choice quotes in
  101. just so we can continue to warp young minds with this sort of thing.
  102.  
  103. Scott Wenzel
  104. Galapagos Development
  105. 772 Crescent Street
  106. Buffalo, New York 14216
  107. 716-835-4821 (please don't call me with your problems)
  108.  
  109. tt
  110. ---------------------------------------------------------------------------
  111. HOW "COMMENT" WORKS:
  112.  
  113. On startup, COMMENT checks to make sure the ANSI driver is loaded and blows
  114. out if it doesn't find it.  Then, it reads the EQU showing the "message block"
  115. count and the number of messages in each.  This version contains seven blocks,
  116. with 25h (or so) messages in each.  Notice that the total number of messages in
  117. this scheme must, therefore, be a multiple of the number of blocks, and that
  118. all blocks must contain the same number of messages.  If you're not literate
  119. enough to actually fill all those message slots, you can pad them out with
  120. blank strings until someone says something amazing you can stick in there.
  121.  
  122. Anyway, it takes the seconds' indicator of the DOS Get Time function, and
  123. divides that by the number of blocks.  The modulus (remainder) of this 
  124. number acts as an offset pointer in JMPTABLE, thus pointing to the block
  125. from which the message will come.  Yes, this means there's a practical limit
  126. of 60 blocks.
  127.  
  128. Then, the routine uses the hundredths' indicator to pick out the message 
  129. offset from the beginning of the designated block.  And yes, this means
  130. there's a practical limit of 100 messages per block, a limit the original
  131. CAVEAT routine suffered from.
  132.  
  133. The resulting offsets are added together, pointing out the message to be
  134. issued.  The regular DOS write-string function displays the message, then 
  135. the routine exits.
  136. ------------------------------------------------------------------------------
  137. COMMAND-LINE PARAMETERS
  138.  
  139. There are some options for COMMENT.  
  140.  
  141. ?
  142.  
  143. "comment ?" displays a help message and short copyright notice.  This includes
  144. a summary of the parameters and the current version number.
  145.  
  146. c
  147.  
  148. "comment c" displays the full copyright notice and information about upgrades
  149. and registration.
  150.  
  151. d
  152.  
  153. "comment d" invokes "dump mode," wherein an equate called TNUM (which should
  154. be placed in the top and should reflect the total count of messages in hex) is
  155. read.  The system then just starts from top to bottom cranking out all quotes.
  156.  
  157. x
  158.  
  159. "comment x" enables you to get out of "wiener mode" and display all the entries
  160. in COMMENT, including the off-color ones.  This is the only param that can be
  161. combined with others, but X has to come first!
  162.  
  163. #
  164.  
  165. "comment" followed by a number from 2 to 9 spits out that many random quotes.
  166. In practical terms, for a 24-line screen the best number is 3.  Entering 0
  167. or a number larger than 9 results in you getting either 1 message or whatever
  168. the first nonzero digit is.  Entering any non-numeric gets you 1 message, too.
  169.  
  170. p
  171.  
  172. "comment p" (or some combination of the above) will wait for you to press a
  173. key following message display.  Can be used in dump mode, but who needs it?
  174.  
  175. w
  176.  
  177. "comment w" causes COMMENT to wait about five seconds and then return to DOS.
  178. Use this mode for unattended operation.
  179.  
  180. You can use a slash or a dash as a parameter indicator, or use nothing.  The
  181. program has been told to ignore everything it can't eat.
  182.  
  183. Therefore,  COMMENT c, COMMENT /c and COMMENT -C (or, hell, COMMENT @!@$!%@C)
  184. are all treated identically.
  185.  
  186. COMMENT can be redirected to standard output, which means you can enjoy all
  187. the messages by sending a dump to LPT1:.  Cheaters.
  188. ------------------------------------------------------------------------------
  189. MODIFYING COMMENT.ASM
  190.  
  191. To change any existing messages, just alter the text, keeping in mind things
  192. like line breaks, single quotes or apostrophes-if-you-use-them, and DOS' 
  193. requirements for the formatting of data for the INT 21h write-string 
  194. function.  I have adhered to a certain standard of appearance in entering
  195. these messages, and would appreciate this being continued.
  196.  
  197. HOW MESSAGES HAVE BEEN FORMATTED IN COMMENT
  198.  
  199. Messages have been set up as follows.  If a message is a direct quote, it has
  200. on its first line a double quote.  Succeeding lines of that quote are indented
  201. exactly one character.  Quotes of quotes are set off with a single quote.
  202. All apostrophes are inset by inserting a literal ascii code 39 in the text --
  203. there are many examples of this.
  204.  
  205. All quotes from material or people are attributed.  This includes the author,
  206. the name of the song or poem or piece or whatever, the album or collection
  207. it's from, the year of publication, and as much other information as can be
  208. obtained.  If you include "surprising quotes," stuff people may have heard
  209. but don't generally know where it came from, be SURE you do this.  The 
  210. attribution is set up as follows:  3 leading spaces, a hyphen, a single space,
  211. then the attribution.  Any succeeding lines of attribution are set in to
  212. indent 5 spaces so they align with the first meaningful character in Line 1,
  213. NOT the hyphen.  I also try to keep things from taking up the full width of 
  214. the screen.  Or the full height, either.  Don't try to excerpt "Gone With
  215. The Wind" or "War and Peace" in here.  It's counterproductive.
  216.  
  217. FIDDLING WITH THE NUMBERS, ETC.
  218.  
  219. To increase the number of messages within each block, increase the equate
  220. for this at the top of the file, then go in and move the "MBLOCKx" markers
  221. so that they occur every "x" number of messages.  For instance, if you have
  222. three blocks, sixteen messages per block, MBLOCK1 will appear at the M10
  223. position, MBLOCK2 will appear at M20, etc.  If you change this to seventeen
  224. messages per block, MBLOCK1 will appear next to M11, MBLOCK2 will be next
  225. to M22, etc.
  226.  
  227. To add a new block, increase the equate at the top, and add in an entry to
  228. the JMPTABLE below whatever MBLOCK listing is already there.  Then, go down 
  229. to the bottom of the offset listings, and add in that same MBLOCKx entry,
  230. followed by enough Mxx entries to handle the messages-per-block figure.
  231. and lastly, add in the actual quote text.
  232.  
  233. Also, so that dump mode works correctly, change the tnum equate, which dump
  234. mode uses to set a loop to count through them all.  If you add messages and
  235. do not increase this equate, the messages will not appear in the dump, 
  236. though they will of course be displayed if called specifically.
  237.  
  238. ----------------------------------------------------------------------------
  239.  
  240. POSSIBLE IMPROVEMENTS
  241.  
  242. I've thought of a few different ways this could be improved. One is to
  243. allow for user-editing of messages, but then again, that would take away
  244. programmers' creative license.  Another idea was to make it memory-resident,
  245. burping out quotes at random times and when least expected.  A version I have
  246. also been working on would latch onto the keyboard buffer and randomly
  247. insert quotes into whatever you were typing at the time... a great way to 
  248. spice up those drab office memos and reports.  See who actually reads them!
  249.  
  250. If you wanna force people to load the ANSI driver or equivalent, you could
  251. insert escape codes for color, screen position, etc.   I use these for some
  252. items, but limit myself to bold or underline or flashing characters only.
  253. I imagine you could use ANSI color and cursor-positioning, but I don't because
  254. many people have only monochrome and color would be wasted.
  255.  
  256. If you use off-color comments, load them into whatever the LAST mblock is
  257. (highest number) that you have defined.  If you do not invoke the X option,
  258. the last mblock is ignored and none of the messages in it will be displayed.
  259. Yes, this means there's a limit on the number of rowdy messages you can
  260. have, but if you change the amounts associated with XRATE, you can have 
  261. it mark off several mblocks if you want.  How much do you really want anyhow?
  262.  
  263. ----------------------------------------------------------------------------
  264. ABOUT COMMRES.ASM:
  265.  
  266. This is a version I wanted to try that would load memory-resident and then 
  267. be popped up at any time for a quick comment in the middle of other things.
  268. I began work on this in December, 1989 and developed a version that at least
  269. would load correctly and not screw up other TSRs, though I still have not
  270. fathomed the mystery of which DOS interrupts are safe to use during a TSR.  It
  271. will involve a lot of rewriting of COMMENT.
  272.  
  273. The present pre-alpha version sits on the keyboard interrupt.  I have thought
  274. of doing it to sit on the clock and erupt every few minutes.  There are lots of
  275. possibilities.
  276.