"smallest possible" is exactly one instruction; possibly 0xc3 [ret] or 0x90 [nop]; the problem lies in how you define "complete Windows application", because the answer really differs depending on if you want to make it ABI compliant. But there's nothing preventing you from creating a custom loader/executor that reads a pure binary file, maps it as exec and runs it.
The smallest meaningful program for MS-DOS was exactly 2 bytes:<p><pre><code> FA F4
</code></pre>
That's CLI HLT, which effectively deadlocked the machine. Had to be saved as a .com fule obviously, not as an .exe.
Windows and assembly is a fun topic!<p>Putting the search terms "Windows" and "assembly language" turns up all sort of books. The one that got me to initially explore the topic (from 1993).... [0]<p>For a more up to date treatment of assembly and windows.... comes with source code for the IDE also. Ray Seyfarth's book [1].<p>[0] Windows Assembly Language & Systems Programming: Object Oriented & Low-Level Systems Programming in Assembly Language for Windows 3.X<p>[1] Introduction to 64 Bit Windows Assembly Language Programming: Fourth Edition
ISBN-13: 978-1543138849, ISBN-10: 1543138845
Interesting to bypass CRT and work directly against the Windows API. That said, these rely on USER.32.DLL and KERNEL32.DLL to do the majority of the heavy lifting.<p>It's a bit like 'smallest hello world in assembly' but the code is just setting up the calling convention and then passing the zero-terminated character string into `write`. Cool, but that could be done a bit more straightforwardly in C, too. A lot of assembly (including in the linked repository) is book-keeping for the platform's calling convention.
> That said, these rely on USER.32.DLL and KERNEL32.DLL to do the majority of the heavy lifting.<p>Since the low-level Windows kernel API is undocumented and non-public, using these system DLLs is your only option on Windows.<p>It's just like linking against libc.so on any POSIX systems.
no, you can also call ntdll (or even syscalls although those <i>aren't</i> stable), there's plenty of documentation on the internet<p>but also why would you, not much point except for very niche functionality
It’s a minimal Windows app, so the whole idea is to rely on Windows DLLs as much as possible.
Meanwhile in the Unix world you can go as low as 45 bytes <a href="https://www.muppetlabs.com/~breadbox/software/tiny/teensy.html" rel="nofollow">https://www.muppetlabs.com/~breadbox/software/tiny/teensy.ht...</a>
Unfair comparison. The Windows tool (FTA):<p><i>“Runs a Windows message loop
Has a title bar, minimize, maximize, and close buttons, which all work as expected
Has a system menu with the same
Paints the background and some text centered in the middle, equal to or larger than "Dave's Tiny App"”</i><p>That Linux program:<p><i>“Let’s take an incredibly simple program, one that does nothing but return a number back to the operating system”</i><p>See <a href="https://archive.is/w01DO#selection-265.0-265.44" rel="nofollow">https://archive.is/w01DO#selection-265.0-265.44</a> for a fairer comparison (97/133 bytes)
97 bytes for Windows at the time this very nice walkthrough was written: <a href="http://www.phreedom.org/research/tinype/" rel="nofollow">http://www.phreedom.org/research/tinype/</a>
Goodness gracious me.-
<a href="https://en.wikipedia.org/wiki/Goodness_Gracious_Me_(song)" rel="nofollow">https://en.wikipedia.org/wiki/Goodness_Gracious_Me_(song)</a>
I hope that expression makes a comeback.
For more of the same (though I wish source was available) which actually does something useful, see the various small utilities at<p><a href="https://www.grc.com/freepopular.htm" rel="nofollow">https://www.grc.com/freepopular.htm</a>
I should try FASM to see if it produces a smaller size exe. COM files are small, but 16-bit DOS was the thing back in the day - 100H yeah and basically a memory dump.
Appreciate you writing it up
The developer, Dave Plummer, left Microsoft to develop and distribute malware and scams in the 90s. See previous thread at [1].<p>Nowadays he spreads misinformation disguised as war stories from his time at Microsoft.<p>[1]: <a href="https://news.ycombinator.com/item?id=39813625">https://news.ycombinator.com/item?id=39813625</a>
What about his contributions to human civilization? ;)<p>He got a world record score on the Tempest arcade game [1], then developed an AI which beat his own record[2]. His biggest failure was, that after rebuilding TEMPEST from arcade machine ROMS, he added levels to the game but never made them public [3].<p>[1]. <a href="https://www.youtube.com/watch?v=EuSMCWu02hA" rel="nofollow">https://www.youtube.com/watch?v=EuSMCWu02hA</a><p>[2]. <a href="https://www.youtube.com/watch?v=TdbpoDjIvPk" rel="nofollow">https://www.youtube.com/watch?v=TdbpoDjIvPk</a><p>[3]. <a href="https://www.youtube.com/watch?v=BjsVSEbXDOM" rel="nofollow">https://www.youtube.com/watch?v=BjsVSEbXDOM</a>
It's frustrating, because he does do some cool things. But I had to quit following him because of his constant yarning about how he grew up not rich and made millions from Microsoft, so young people now are stupid and lazy.
Dave Cutler was a guest in his garage and it was a great episode. That lands some gravity at least?
My how the overton window has moved. Some of violative conduct is standard practice now.<p>> When consumers prepared to purchase a product, additional services and products including a $9.95 back-up disc and $4.95 ‘optional extended service’ plan appeared on the check-out form. The form also listed “one free year of updates” – selected by default – but the company was then authorized to automatically charge a consumer’s credit card at the end of the year unless the buyer cancels the update plan.
But also things that are absolutely not okay:<p>> Inducing computer users to install software by misrepresenting that the user's computer is at risk for crashes or privacy and security invasions.<p>> Marketing its InternetShield software by means of a “free scan.”<p>> Using “buttons” in its advertisements that do not function as the user would expect them. For example, the X found in the corner of a window is normally associated with closing the window and should not open another ad.
Installing software on a user’s computer that causes multiple pop-up advertisements when the user tries to close out of advertisements.<p>> Failing to provide a functional uninstall option for removing all software files.<p>> Failing to obtain a consumer’s explicit consent to purchase a product or a service.
Do you have any evidence of these (unsubstantiated) claims against him?
He also lied about his contributions to Start menu
love this and it's timely as I think with AI more of my code will just be native assembly for example: <a href="https://github.com/taf2/tic-tac-toe" rel="nofollow">https://github.com/taf2/tic-tac-toe</a> my m series native assembly based tic tac toe windowed game... very portable too you just simply execute codex --yolo port my app to x y z host...
I haven't played with yolo yet. I'll have to use my airgapped, old Lenovo ThinkPad for this! Whenever I see yolo, I can't stop thinking of Joseph Redmon's YOLO and his astounding resume format!