3 ms·
Normally these demos are filled with all kinds of 'tricks' to make things smaller. Things like self modifying code, using bits of the bios or video ROM in ways
by londons_explore 7y ago
Normally these demos are filled with all kinds of 'tricks' to make things smaller.
Things like self modifying code, using bits of the bios or video ROM in ways they weren't intended by jumping into the middle of them, saving space by using code as data or vice versa, tiny packers which compress or uncompress the code, massive pregenerated buffers to do runtime lookups to generate data in one order but use it in another, etc.
This seems very vanilla in comparison...
- IvyMike 7y agoNote your comment about how unimpressed you are is 214 bytes longer than the demo.
- nullc 7y agoObviously he didn't do any 'tricks' to make it smaller.
- saagarjha 7y agoIf only I could persistently XSS Hacker News and this comment could be self-modifying as well…
- tripzilch 7y agoThere's quite a few 'tricks' in the small bits of asm in the article. Also, the tiny unpackers are generally used from 4096b and upwards. The size of the unpacker takes too much space and doesn't make up for the compression ratio at 256b.
- exikyut 7y agoMay I please have a list of demos that do all those things? That sounds really cool. - Jumping into the middle of video ROM and/or the BIOS - Using substantial amounts of code as data - Pregenerated buffers and data reordering oooooo.
- HellMood 7y ago(author here) Well, he is not entirely wrong. There is "m8trix", an 8 byte program (later optimized to seven bytes), that does - jump into the middle of it's own instructions - using 2 of that 7 bytes again as DATA - using FLAG register content as COLOR See : http://www.sizecoding.org/wiki/M8trix_8b http://www.sizecoding.org/wiki/M8trix_8b But all that doesn't really cut the space down in something as "big" as 256 bytes, it's the approach and the algorithms that do =)