438-byte "Hello, world" Win32 EXE in D

Don via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Thu Sep 11 00:41:27 PDT 2014


On Wednesday, 10 September 2014 at 13:53:32 UTC, Marco Leise 
wrote:
> Am Tue, 09 Sep 2014 10:20:43 +0000
> schrieb "Don" <x at nospam.com>:
>
>> On Monday, 8 September 2014 at 08:18:32 UTC, Ola Fosheim 
>> Grøstad wrote:
>> > On Monday, 8 September 2014 at 08:08:23 UTC, Kagamin wrote:
>> >> But that downloaded file is bloatware, because it has to 
>> >> implement functionality, which is not provided by the 
>> >> system. That tiny pe file doesn't download anything, it's 
>> >> completely done by the system.
>> >
>> > Yeah…
>> >
>> > http://stackoverflow.com/questions/284797/hello-world-in-less-than-20-bytes
>> 
>> My personal best --
>> 
>> At my first job, a customer once made a request for a very 
>> simple DOS utility. They did mention that they didn't have 
>> much disk space on their machine, so they asked me to try to 
>> make the program small.
>> That was a once-in-a-lifetime opportunity. Naturally, I wrote 
>> it in asm.
>> The final executable size was 15 bytes. <g>
>> The customer loved it.
>
> Vladimir: Good job!
> Don: Nice story. What did it do?

It blanked the screen in a particular way. It was purely for 
aesthetic reasons.

> During my time at a vocation school I wrote some stuff like a
> tiny Windows media player with some of the ASM in the DOS/PE
> header area. And an animated GIF player in ASM as a .com
> executable with the GIF included in it. (Easy since GIF
> algorithms are 16-bit and they use 8-bit color palettes)

Nice.
That was the only time I ever made a commercial release that was 
entirely in asm. It only took me about ten minutes to write. It 
would have been far more difficult in another language.

On Wednesday, 10 September 2014 at 14:17:25 UTC, ketmar via 
Digitalmars-d-announce wrote:
> On Wed, 10 Sep 2014 16:02:01 +0200
> Marco Leise via Digitalmars-d-announce
> <digitalmars-d-announce at puremagic.com> wrote:
>
>> > The final executable size was 15 bytes. <g>
>> > The customer loved it.
> and they never knows that it took at least 512 bytes anyway. or 
> even
> more, depending of claster size. heh.

Yeah. Plus the filename took up almost as much space as the 
executable code. But when they said they wanted it to be small, 
they actually meant "less than 2 megabytes". When our sales guy 
saw it, he said, "You got it down to 15kb? That's incredible!"

But I won't pollute D.announce any more. :)


More information about the Digitalmars-d-announce mailing list