home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PROGRAMS / UTILS / NOVELL / COM302.ZIP / COMM302.DOC next >
Encoding:
Text File  |  1991-01-07  |  16.7 KB  |  311 lines

  1. COMMENT
  2. (c) 1987, 1988, 1989, 1990, 1991 Galapagos Development and Scott Wenzel
  3. 29 South Charles Street, Red Lion, PA  17356
  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. │                 -  SPACE - musical and graphical free-space display for HD  │
  14. │                                                                             │
  15. │~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~│
  16. │  Register now!  Register now!  Register now!  Register now!  Register now!  │
  17. │                                                                             │
  18. └─────────────────────────────────────────────────────────────────────────────┘
  19. Register your copy of this program by sending me your name, address, the
  20. version number you are using (displayable by invoking COMMENT ?), and
  21. $8.00 in US money.  Thanks to you, it's working.
  22.  
  23. As a greater incentive, anyone registering with $15 or more will get a future
  24. updated version of COMMENT on disk.  You also have the option of getting the
  25. ASM source code if you want it.  You're then on your own.
  26.  
  27. Speaking of commercials, let me say that starting with Version 2.61, all copies
  28. of COMMENT contain a "commercial" that comes up now and then in spectacular
  29. fashion to encourage you to register and get all sorts of goodies like these.
  30.  
  31. By the way, let me know WHERE you got this copy of COMMENT.  I always
  32. like to see the information supply lines at work.  It's an odd feeling dialing
  33. into a new BBS and finding your own program got there before you did.
  34.  
  35.  
  36. VERSION HISTORY -- COMMENT.ASM
  37.  
  38. Version 1.00 04/15/87  --  original version with 20 quotes -- written for MASM
  39. Version 1.40 06/01/87  --  expanded to 75 quotes
  40. Version 1.90 09/15/87  --  expanded to 100 quotes
  41. Version 2.09 05/30/88  --  reworked algorithm to include blocks and pointers
  42. Version 2.10 12/15/88  --  expanded to 115 quotes - no longer MASM-compatible
  43. Version 2.11 06/01/89  --  expanded to 123 quotes, added separator lines
  44. Version 2.12 07/26/89  --  expanded to 125 quotes, corrected some items
  45. Version 2.13 08/17/89  --  changed about a dozen quotes and updated others
  46. Version 2.20 10/17/89  --  made formatting consistent, began use of ANSI codes
  47. Version 2.30 10/23/89  --  expanded to 160 quotes
  48. Version 2.31 11/21/89  --  expanded to 169 quotes and added command-line parms
  49. Version 2.41 12/22/89  --  expanded to 205 quotes, rewrote subroutine calls for clarity
  50. Version 2.50 12/23/89  --  added "dump" mode to spit out all messages for diagnostic uses
  51. Version 2.55 01/07/90  --  expanded to 285 quotes -- went from 5 to 7 mblocks
  52. Version 2.61 01/31/90  --  added X option - enables off-color quotes, (to get 
  53.                            out of "wiener mode"), added more stuff, fixed bug
  54.                            in dump mode that prevented display of first item 
  55.                            and caused crap at end of dump; added commercials.
  56. Version 2.70 04/09/90  --  added checking for ANSI driver (now req'd.)
  57. Version 2.80 06/05/90  --  expanded to 325 quotes, added pause option and timed
  58.                            wait-after-display option
  59. Version 2.81 06/19/90  --  more stuff, fixed wait mode to be speed independent
  60. Version 2.82 09/29/90  --  still more material, cleaned up wait-vs-pause
  61. Version 2.83 11/15/90  --  Corrected some material, added more
  62. Version 3.00 12/13/90  --  Added keyword-searching option and more quotes
  63. Version 3.01 12/21/90  --  Added failed-to-find message and some new material
  64. Version 3.02 01/07/91  --  Bug fix, corrected failure of /w and /p after the
  65.                            /f parameter was added.  Added short pause between
  66.                            multiple found messages.  And, as always, new stuff
  67. -----------------------------------------------------------------------------
  68. VERSION HISTORY -- COMMRES.ASM
  69.  
  70. Version 0.01 12/12/89  --  Testing version; problems with segment pointers -- not operable
  71. Version 0.10 12/14/89  --  Testing version; still pointer problems but does install correctly
  72. Version 0.25 01/04/90  --  Testing version; working out way to do windowing
  73. Version 0.30 04/01/90  --  Miserable failure; project on hold
  74. -----------------------------------------------------------------------------
  75. COMMENT.ASM and COMMENT.COM Version 2.0 - 3.0+
  76. COMMRES.ASM and COMMRES.COM Version 0.01 - 1.0+
  77.  
  78. (c) Copyright 1987, 1988, 1989, 1990, 1991  Scott Wenzel
  79. Commercial redistribution prohibited
  80. No fee may be charged for distribution of any portion of this code or any
  81. executable program or derivative created from any portion of this code.
  82. NOTE!
  83. NOTE!
  84. NOTE!
  85.  
  86. This program is designed to spit out a lot of odd messages from a hard-coded
  87. internal pile of around 350 or so.  It uses a random-selection feature, with
  88. attention paid to various command-line options, to select the new and
  89. bizarre message to be spat out onto your screen.  It uses all DOS and BIOS
  90. calls and thus should run anywhere.  The original routine was rooted in a long-
  91. forgotten program called CAVEAT, which I ripped to smithereens and rebuilt
  92. stronger and more powerful.  Since the new selection and indexing 
  93. routine uses the seconds' AND hundredths' timer of the DOS clock in a
  94. dual-indexing scheme in order to come up with its pseudo-random choice of
  95. quotes, any of you geniuses can go ahead and tweak it to read the date or
  96. something or factor in the month or whatever and thus be able to have
  97. (theoretically) thousands of quotes in here (see your assembly language manual
  98. under the heading of "Memory Segment Limits."  See also "65,535") Go ahead and
  99. modify it all you want, but leave some of the quotes in, and also leave all
  100. this stuff in so we can keep some kind of revision history and therefore not
  101. reinvent the wheel.  Leave a few of the choice quotes in just so we can
  102. continue to warp young minds with this sort of thing.
  103.  
  104. Scott Wenzel
  105. Galapagos Development
  106. 29 South Charles Street
  107. Red Lion, Pennsylvania 17356
  108. 717-246-2697 (please don't call me with your problems)
  109.  
  110. tt
  111. ---------------------------------------------------------------------------
  112. HOW "COMMENT" WORKS:
  113.  
  114. On startup, COMMENT checks to make sure the ANSI driver is loaded and blows
  115. out if it doesn't find it.  Then, it reads the EQU showing the "message block"
  116. count and the number of messages in each.  This version contains seven blocks,
  117. with 25h (or so) messages in each.  Notice that the total number of messages in
  118. this scheme must, therefore, be a multiple of the number of blocks, and that
  119. all blocks must contain the same number of messages.  If you're not literate
  120. enough to actually fill all those message slots, you can pad them out with
  121. blank strings until someone says something amazing you can stick in there.
  122.  
  123. Anyway, it takes the seconds' indicator of the DOS Get Time function, and
  124. divides that by the number of blocks.  The modulus (remainder) of this 
  125. number acts as an offset pointer in JMPTABLE, thus pointing to the block
  126. from which the message will come.  Yes, this means there's a practical limit
  127. of 60 blocks.
  128.  
  129. Then, the routine uses the hundredths' indicator to pick out the message 
  130. offset from the beginning of the designated block.  And yes, this means
  131. there's a practical limit of 100 messages per block, a limit the original
  132. CAVEAT routine suffered from.
  133.  
  134. The resulting offsets are added together, pointing out the message to be
  135. issued.  The regular DOS write-string function displays the message, then 
  136. the routine exits.
  137. ------------------------------------------------------------------------------
  138. COMMAND-LINE PARAMETERS
  139.  
  140. There are some options for COMMENT.  
  141.  
  142. ?
  143.  
  144. "comment ?" displays a help message and short copyright notice.  This includes
  145. a summary of the parameters and the current version number.
  146.  
  147. c
  148.  
  149. "comment c" displays the full copyright notice and information about upgrades
  150. and registration.
  151.  
  152. d
  153.  
  154. "comment d" invokes "dump mode," wherein an equate called TNUM (which should
  155. be placed in the top and should reflect the total count of messages in hex) is
  156. read.  The system then just starts from top to bottom cranking out all quotes.
  157.  
  158. x
  159.  
  160. "comment x" enables you to get out of "wiener mode" and display all the entries
  161. in COMMENT, including the off-color ones.  This is the only param that can be
  162. combined with others, but X has to come first!
  163.  
  164. #
  165.  
  166. "comment" followed by a number from 2 to 9 spits out that many random quotes.
  167. In practical terms, for a 24-line screen the best number is 3.  Entering 0
  168. or a number larger than 9 results in you getting either 1 message or whatever
  169. the first nonzero digit is.  Entering any non-numeric gets you 1 message, too.
  170.  
  171. p
  172.  
  173. "comment p" (or some combination of the above) will wait for you to press a
  174. key following message display.  Can be used in dump mode, but who needs it?
  175.  
  176. w
  177.  
  178. "comment w" causes COMMENT to wait about five seconds and then return to DOS.
  179. Use this mode for unattended operation.
  180.  
  181. You can use a slash or a dash as a parameter indicator, or use nothing.  The
  182. program has been told to ignore everything it can't eat.
  183.  
  184. Therefore,  COMMENT c, COMMENT /c and COMMENT -C (or, hell, COMMENT @!@$!%@C)
  185. are all treated identically.
  186.  
  187. f
  188.  
  189. "comment f" followed by a word or phrase causes COMMENT to search the message
  190. base and spit out all the quotes that contain that phrase.  Please note that
  191. there's a small bug in the program somewhere that, if you select an extremely
  192. popular word or phrase (try "Carlin") the program gets excited and starts
  193. spitting out some extra quotes that have nothing to do with what you wanted.
  194. I'll fix that some day.  Please note also that the F option is case-sensitive,
  195. so if you type in "Cat" and the only occurence is "cat" you will not get the
  196. quote displayed.  I suggest you try both ways, or optionally (on longer
  197. search phrases) leave off the first letter.  Thus, COMMENT /Fomputer will get
  198. you anything containing "Computer" or "computer" but will not get you (at least
  199. in this version) "COMPUTER."  No other options work with /F, and as warning,
  200. *when you use /F the /X option is turned on and cannot be disabled!*  So if you
  201. go searching for naughty words, you'll get them whether you want to or not.
  202.  
  203. If the search finds nothing, you'll be so informed.
  204.  
  205. The "F" option was by far the most fun to write.  Just for trivia's sake.
  206.  
  207. -----------------------------------------------------------------------------
  208. An extra note:
  209.  
  210. COMMENT can be redirected to standard output, which means you can enjoy all
  211. the messages by sending a dump to LPT1:.  Cheaters.  Your output will probably
  212. contain some ANSI escape sequences -- no telling what they may do to your
  213. printer output, so be prepared.  I have not included any means to filter out
  214. the ANSI sequences, because I kind of like them.
  215. ------------------------------------------------------------------------------
  216. MODIFYING COMMENT.ASM
  217.  
  218. To change any existing messages, just alter the text, keeping in mind things
  219. like line breaks, single quotes or apostrophes-if-you-use-them, and DOS' 
  220. requirements for the formatting of data for the INT 21h write-string 
  221. function.  I have adhered to a certain standard of appearance in entering
  222. these messages, and would appreciate this being continued.
  223.  
  224. HOW MESSAGES HAVE BEEN FORMATTED IN COMMENT
  225.  
  226. Messages have been set up as follows.  If a message is a direct quote, it has
  227. on its first line a double quote.  Succeeding lines of that quote are indented
  228. exactly one character.  Quotes of quotes are set off with a single quote.
  229. All apostrophes are inset by inserting a literal ASCII code 39 in the text --
  230. there are many examples of this.
  231.  
  232. All quotes from material or people are attributed.  This includes the author,
  233. the name of the song or poem or piece or whatever, the album or collection
  234. it's from, the year of publication, and as much other information as can be
  235. obtained.  If you include "surprising quotes," stuff people may have heard
  236. but don't generally know where it came from, be SURE you do this.  The 
  237. attribution is set up as follows:  3 leading spaces, a hyphen, a single space,
  238. then the attribution.  Any succeeding lines of attribution are set in to
  239. indent 5 spaces so they align with the first meaningful character in Line 1,
  240. NOT the hyphen.  I also try to keep things from taking up the full width of 
  241. the screen.  Or the full height, either.  Don't try to excerpt "Gone With
  242. The Wind" or "War and Peace" in here.  It's counterproductive.  Also, in the
  243. ASM code, many, many lines are wider than 80 columns! If you have a text editor
  244. that can only go to 80, 127, or 255 columns, I suggest you junk it and get
  245. something else.  I have used the Norton Editor for years and am pleased with
  246. its seemingly unlimited line width handling.  Put it this way:  Norton can
  247. handle a much wider line than my assembler can.
  248.  
  249. FIDDLING WITH THE NUMBERS, ETC.
  250.  
  251. To increase the number of messages within each block, increase the equate
  252. for this at the top of the file, then go in and move the "MBLOCKx" markers
  253. so that they occur every "x" number of messages.  For instance, if you have
  254. three blocks, sixteen messages per block, MBLOCK1 will appear at the M10
  255. position, MBLOCK2 will appear at M20, etc.  If you change this to seventeen
  256. messages per block, MBLOCK1 will appear next to M11, MBLOCK2 will be next
  257. to M22, etc.  Remember that we're counting in hex.
  258.  
  259. To add a new block, increase the equate at the top, and add in an entry to
  260. the JMPTABLE below whatever MBLOCK listing is already there.  Then, go down 
  261. to the bottom of the offset listings, and add in that same MBLOCKx entry,
  262. followed by enough Mxx entries to handle the messages-per-block figure.
  263. and lastly, add in the actual quote text.
  264.  
  265. Also, so that dump mode works correctly, change the tnum equate, which dump
  266. mode uses to set a loop to count through them all.  If you add messages and
  267. do not increase this equate, the messages will not appear in the dump, 
  268. though they will of course be displayed if called specifically.
  269.  
  270. ----------------------------------------------------------------------------
  271.  
  272. POSSIBLE IMPROVEMENTS
  273.  
  274. I've thought of a few different ways this could be improved. One is to
  275. allow for user-editing of messages, but then again, that would take away
  276. programmers' creative license.  Another idea was to make it memory-resident,
  277. burping out quotes at random times and when least expected.  A version I have
  278. also been working on would latch onto the keyboard buffer and randomly
  279. insert quotes into whatever you were typing at the time... a great way to 
  280. spice up those drab office memos and reports.  See who actually reads them!
  281.  
  282. You could get very snazzy with the ANSI driver support.  You could perhaps
  283. insert escape codes for color, screen position, etc.   I use ANSI for many
  284. items, but limit myself to bold or underline or flashing characters only.
  285. I imagine you could use ANSI color and cursor-positioning, but I don't because
  286. many people have only monochrome and color would be wasted.
  287.  
  288. If you use off-color comments, load them into whatever the LAST mblock is
  289. (highest number) that you have defined.  If you do not invoke the X option,
  290. the last mblock is ignored and none of the messages in it will be displayed.
  291. Yes, this means there's a limit on the number of rowdy messages you can
  292. have, but if you change the amounts associated with XRATE, you can have 
  293. it mark off several mblocks if you want.  How much do you really want anyhow?
  294. Nasty as they wanna be, I guess.
  295.  
  296. Eventually I will have to write this as a Windows application just to keep
  297. up with things.  Someday I may make the message blocks user-editable.  Maybe.
  298. ----------------------------------------------------------------------------
  299. ABOUT COMMRES.ASM:
  300.  
  301. This is a version I wanted to try that would load memory-resident and then 
  302. be popped up at any time for a quick comment in the middle of other things.
  303. I began work on this in December, 1989 and developed a version that at least
  304. would load correctly and not screw up other TSRs, though I still have not
  305. fathomed the mystery of which DOS interrupts are safe to use during a TSR.  It
  306. will involve a lot of rewriting of COMMENT.
  307.  
  308. The present pre-alpha version sits on the keyboard interrupt.  I have thought
  309. of doing it to sit on the clock and erupt every few minutes.  There are lots of
  310. possibilities.
  311.