Documentation file (23 lines) for WC (Word Counter program) David Coons (CIS [72435,136]) February, 1984 ---------------------------------------------------------------------- My wife writes short stories, and was in need of a way to get an approximate word count of a WordStar file. To my delight, in K&R ("The C Programming Language", BW Kernighan and DM Ritchie, Englewood Cliffs, NJ: Prentice-Hall, 1978, page 18) I found a simple word count algorithm, which I converted to 8080 assembler code. It's not fancy, but it works. It does need one feature to work better with WordStar files, however: ignore all lines beginning with a "." (e.g., .MT 6). WC counts words in any text file, and displays the count on the console in the form, "File contains 00000 words". A word is defined as any character sequence surrounded by 'white space' (i.e., spaces, tabs, carriage returns, or line feeds. (WC will ignore the high order bit in all file characters.) To run WC, simply type: WC filename.ext WC cannot process wildcard filenames (e.g., WC B:*.TXT is illegal). As far as performance goes, a 3200-word file took approximately seven seconds, including the one or two seconds CP/M took to load the WC program.