11.07.2015 Views

Untitled - TRS-80 Color Computer Archive

Untitled - TRS-80 Color Computer Archive

Untitled - TRS-80 Color Computer Archive

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

ief explanation of the theory behind the program. The basic concept is to economize on the storageof often-repeated information.Nearly every collection of data involves a significant amount of repetition. For instance, the letter eappears very frequently in wordprocessing documents, most graphics screens contain substantialamounts of blank space, and soforth. File Compressor saves spaceby storing the most frequently repeated data values in less spacethan usual. To understand how thisis done, you'll need to know a littleabout how the computer usuallystoresinformation.The 64 ordinarily stores alldata as a series of byte-lengthcodes. A byte consists of eight bits,and each bit is a binary digit (either1 or 0). The binary number00000000 equals 0, and the binarynumber 11111111 equals decimal255, so a byte can store a number inthe range 0-255. Since every bytecontains eight bits, the computersimply counts bits to determinewhere one code ends and the nextbegins. When it reaches the eighthbit, it knows that the following bit isthe first bit of the next code.(Keep in mind that the meaning of a code depends entirely onthe context in which it's used. Forword processing, a code of 65 mayrepresent the ASCII value for thecharacter a. But for a sprite shape orhi-res graphics screen, the samecode represents a pattern of dots. Ina machine language program, 65represents an EOR instruction, andsoon.)File Compressor saves spaceby storing the most often-usedcodes in fewer than eight bits. Toillustrate, say that you wish to savea word processing document incompressed form. Before it savesthe file, File Compressor scans thedocument to determine which sevencharacters appear most frequently.Let's say that those characters are e,a, d, t, r, n, and /. The programwould create this coding table:CodeCharacter1e2a3dThe decoding table is stored at4t5r6n71the beginning of the disk file as wellas in memory. Note that the mostfrequently used character (e, in thisexample) is stored in one bit ratherthan the usual eight. Throughoutthe saving process, File Compressorsubstitutes these short codes inplace of the usual eight-bit codes.To reload the compressed data, theprogram reads the decoding tablefrom disk and stores it, then decodes the file bit by bit.Decoding the compressed fileis somewhat trickier than compressing it. Because the file containscodes of varying sizes (anywherefrom one to eight bits in length), it'snecessary to use a special methodfor detecting the end of one codeand the beginning of the next. FileCompressor does this by using a 0bit as an end-of-code marker. As itreads in each bit from disk, theprogram increments a counter tokeep track of how many 1 bits it hasread. When it finds a 0, it uses thecounter value as an index to thedecoding table. In this example, forinstance, the decoding table indicatesthat six 1 bits stand for the ASCIILearnandUnderstandInsideA book for all GEOS users, from thebeginner to the programmer.Starts out with a introductionto GEOS and its applicationsto creating your own GEOSapplications, GEOS fileformats and internalworkings of GEOS.A must for everyone thatwants to learn and understanGEOS inside and out.and OutAvailableNOW$19.95Abacus Phone 616/241-5510P.O. Box 7219 Dept.C2 Grand Rapids, MI 49510Telex 709-101 • Fax 616S41 -5021Call now for the name of the dealer nearest you. Or orderdirectly using your MC, Visa or Amex card. Add $4.00per order for shipping. Foreign orders add $10.00 peritem. Call today or write for your free catalog. Dealerinquires welcome-over 1500 nationwide.ENTERTHE FINALFRONTIEROFMAN-TO-MACHINECOMMUNICATIONSThere is nothing else likeit. Voice Master givesboth speech outputand voice recognition with this single hardware product! Your voicecontrols programs, or home appliances, robots, and more with spokencommands. Verbal response back gives status, verifies, or requests yourreply! Speech output and recognition patterns are recorded in with yourvoice. Or use the voice of your friend, boss, teacher mothe-.. even thefamily pet! Programming Is simple with new commands added to BASIC.A music bonus program lets you write and compose musical scoressimply by humming the tune. Unlimited applications for fun, education,and commercial use. Design your own programs for profit. Sr.neech andrecognition quqlity unsurpassed by even the most sophisticatedmachines. Only Covox provides this high-tech marvel at a price less thanmost common peripherals.The Covox Voice Master comes complete with all hardwareand softwarefor only $89.95. (Add S4 shipping and handling for USA. S6 Conoda S1Doverseas.) Available for Commodore M/128, Apple II. II*. lie. lie. Atari <strong>80</strong>0,<strong>80</strong>0XL 130 XE. Specify when ordering. Visa. MasterCard phone ordersaccepted.Call or write for FREE Voice Master Infopakand special combination package' offers.COVOXiNC, DEPT.C!675-D Conget Street • Eugene. Oregon 97432 • USAAreaCode(503)342-1271 • Telex 7O6O17(Av Alarm UP)54 COMPUTE! February 1987

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!