Re:Asmttpd – Web server for Linux written in amd64 assembly
by mattgodbolt on Tuesday May 19, 2015 @08:25PM
(#9573978)
Indeed! Full details of the string routine at http://xania.org/201406/elites-crazy-string-format if you're interested in quite how mad it was!
Re:Asmttpd – Web server for Linux written in amd64 assembly
by Raphael_Amiard on Tuesday May 19, 2015 @05:59PM
(#9573442)
That is awfully cool stuff, thank you for that ! but to be honest none of that is really specific to assembly. You can do the same thing in C/C++/Ada/Rust/pick your favorite systems language, or even in a higher level language if you don't care so much about data representation.
Re:Asmttpd – Web server for Linux written in amd64 assembly
by frozenport on Wednesday May 20, 2015 @01:08AM
(#9574775)
I would argue this has nothing to do with ASM, one could achieve the same compression with any programming language. The bottom of the linked article has a nice, few lines of Python.
The original 1984 Elite computer game is famous for its huge galaxy full of planets. Each of them had individual names and descriptions such as "Lave is most famous for its vast rain forests and the Laveian tree grub."
Yet those strings were never stored as plain strings. The game had to run in 32kB of memory, so almost all strings were stored in a tokenized form and expanded using a pseudo-random number generator:
http://wiki.alioth.net/index.php/Random_number_generator
That article shows how the planet description strings were stored and reconstructed on the fly. The base representation for the aforementioned description of planet Lave was only a handful of bytes: "\x8F is \x97"
So I think Elite is a pretty good example of an application written in assembly that didn't have anything like a generic string type.