Programming - a course of study assembler Wlodek Black, continued. Data compression methods.
z80
[Continued]
(C) WLODEK BLACK
... Hello again everyone, and return to the topic of
conversation. You a deme DIGITAL TUNE 1? There? Then ask: count
how many sectors it occupies and how many files is. Counted?
That's right, 7 files totaling 173 sector. Will be quite some
time (mine is an hour not taken away), and deme This glimmering
in a single file of 95 sectors. As also compress the data?
The most simple algorithm - tracking flows of identical
bytes and replace them with the design of the form
"marker-prefix" + "data byte" + "how many times to repeat."
This algorithm was used ancient and unreasonable compressor
"RAMPACK DJS" Dmitriy Stepanenko, published in the journal "ZX
+ More" in 1991 (remember that? Do not you remember? And no one
remembers ...). Natural and logical, This approach to the
problem of data compression is not always optimal. Screen
image, for example, may not contain long sequences of identical
bytes in memory, but visually may consist of multiple identical
segments, text symbols, for example. Or may contain a large
"spots" with a uniform structure or even the empty spaces. If
"pass" on-screen area is not consistently on the rise of
addresses but, for example, top-down or familiarity, can be
sometimes detect duplicate sites, and replace them with the
familiar "Marker" + "that repeat the" + "how to repeat", and
"that repeat" may not be a single byte, and, for example, a set
of 8 byte template text symbol. One of the most popular
compressors screen - "Cologne", as it is commonly called -
performs 4 passes through the screen and selects the most
optimal algorithm. Text compression methods are not less
diverse. For example, the most commonly used symbols can be
encoded not a byte, and a smaller number of bits - say, 5 th.
5-bit combinations - 32, which is enough for the alphabet. By
also in Latin characters always reset the 7 th bit, and in
Russian - He always checked, and it is also possible without
any special tricks to throw. With such compression method token
indicates the start and the length of the compressed area, and
then follow, say, a 5-bit patterns, tightly to each other by
shift operations; For example, the first byte contains 5 bits
of the first character, and 3 bits second, the second byte - 2
bits of the second character, 5-bit third character and a bit
of the fourth, and so on. One of the most efficient compressors
textual information - ASC LZPAC. Even a very chaotic texts
clearly do not contain sequences of identical symbols, it
shrinks to 20-30 percent, which at first (Uninitiated) may seem
improbable. Blocks of code is not text, it packs well, too (in
the Anyway, much better than "RAMPACK DJS"). There are
more efficient compressors, for example MSPACK. I will not
insist, but, in my view, to display one of the compressor the
most important characteristics is the ability to run the
unpacker (the software that restores the original data) to any
address, and for text-wrapper - the efficiency of data
compression and ... bug-free (yes, yes, because the experience
of using various "Bookreaders for newspapers and other text
makes mention about so, if I may say, "characterization").
Again, not I will insist, but at first I advise to get a
packers' AS Cologne "for the screen and" ASC LZPAC "for texts
and codes.
If the compression of text compressor, we just win, then
compression of thought, certainly, nothing good will come ... I
is the fact that "NICRON", alas, not a rubber ... Here, I'll
call it a day until the next release, but that topic is not
hung like curtained server, I beg you, my friends, those who
are interested in and sent a "NICRON" questions, do for next
week's "homework": Take the files "M 3 " "M 4", "M 6" from
demos "DIGITAL TUNE 1" and pack them LZPAC-ohm. All questions
compressor, except "Code keep place", respond extremely brief -
Enter, and the question type the address "49152." The results,
of course, to unload the disc at any name. Next, click Reset,
to clear the RAM, and a "clean" car boot files sequentially in
a row "M", "M 0" "M 7". Data from these files are present in
memory and are used together, there is no need to ship them
separately. Unload them in one file with the addresses of 31232
and a length of 21,196 bytes (49,152 +3276-31232). Package and
this file by specifying "Code keep place" = 31232. And finally,
withstood a picture of the demos. This is done as follows: Load
Beysikovy loader "D. TUNE # 1" through "merge", that it does
not start, and run this line: RANDOMIZE USR 23872: RANDOMIZE
USR 15619: REM: SAVE "dt1 $" CODE 16384,6912. AND Picture this
Repack "Cologne" th (if you have not mastered it management,
then hurry to please: all messages in it are made on the
Russian; harvest numbers from the numbers of responses, and the
works). On the next "lesson" we put it all packed files into
one bag ... Ugh! We will make them monozagruzchik, here!
See you next week!
P.S. I take this opportunity to thank Herman and Gleb
(CHIP) for assistance in acquiring software under the CP / M!
Other articles:
|
|
|
|
Programming - a course of study assembler Wlodek Black, continued. Data compression methods.
|
|
|
|
|
|
|
|
|
|
|
|
|