![]() |
Forum Index : Microcontroller and PC projects : Need Basic language compression code
![]() ![]() |
|||||
Author | Message | ||||
CaptainBoing![]() Guru ![]() Joined: 07/09/2016 Location: United KingdomPosts: 2170 |
yep, hateful isn't it - the mixture of standards. ![]() very often CR is used with LF but it is a hangover from teletypes (spooky) that you would home the carriage but then have to issue a separate line feed to prevent over-printing. if you only want a single "newline" then either LF or CR will do - as you are interpreting the codes anyway either will do fine. I just wanted to note that &B00001101 will fit in four bits while &B00010000 will not - it might have helped with the mapping - i.e. if it's &h0D, you don't need to do a lookup and the code to output is the same as the input. Small point. It would simplify your SELECT ... CASE when translating a tiddly bit. I'll get my coat ![]() was it four bits or five you wanted??? in which case ignore my ramblings above |
||||
lizby Guru ![]() Joined: 17/05/2016 Location: United StatesPosts: 3378 |
4 bits for the translation to nybbles of numerals + comma, period, space, colon, LF|CR, and one more if useful. PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed |
||||
twofingers![]() Guru ![]() Joined: 02/06/2014 Location: GermanyPosts: 1593 |
Just for comparisations purposes: WikiBaudot.txt = 12.903 bytes WikiBaudot_encoded.txt = 8.890 bytes (lizbys 5 bit-encoding) WikiBaudot.lzw = 7.507 bytes (LZW-compressor) WikiBaudot.rar = 5.448 bytes (RAR-file) causality ≠ correlation ≠ coincidence |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10315 |
Can you give more information about the text? Is it simple English as in from a novel? Does it contain numbers or is all numbers? Does it have repeated sequences of letters or whitespace? Depending on the answers an algorithm could be developed that could be far more efficient than any generic solution. |
||||
lizby Guru ![]() Joined: 17/05/2016 Location: United StatesPosts: 3378 |
I originally intended a generic ascii file with only the codes 0x20-0x7f, plus LF. I have found out that one specific file I might look to encode is only numerals plus space, comma, period, colon, CRLF, so I plan to do simple 4-bit encoding. PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed |
||||
![]() ![]() |
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |