Hello, Assembly! Retrocoding the World's Smallest Windows App in x86 ASM

preview_player
Показать описание
Dave builds the World's Smallest Windows application live in x86 assembly using only a text editor and the command line to assemble the program using the Microsoft MASM assembler.

Whether you're a professional programmer or just curious about how assembly language works, what makes it different from machine language, and why it can be faster and smaller than C you won't want to miss it! Take your Windows Programming to the next level. Or the previous level, depending on how you look at it!

Link to Mug:

Link to Code:

Thanks in part to a suggestion by 'SonicMouse' that I merge linker sections, the current binary size is 1488 bytes... and yes, it runs exactly the same.

0:00 Start
1:31 Assembly Language vs Machine Language
2:24 Machine Language Monitors
3:22 Hello, Windows!
5:10 Dave's Garage Mug
5:30 Task Manager Enamel Pins
6:04 Editor Sequence Start
10:15 Includes, Libs, Constants, Data
12:00 Main Entry
13:30 ShowWindow
15:11 WinMain
17:10 WindowClass
21:37 WndProc
26:15 Command Line
28:08 Running the App
28:30 Closing Thoughts

Environment: Windows 10 2H02, MacOS 11.2.2
GNU Nano Editor
Microsoft MASM SDK

PS: For anyone keeping score, two things are certain: (a) it can always be smaller, and I'm down to 1488 bytes now, and (b) Steve Gibson has likely forgotten as much about x86 assembly programming as I know :-). Thanks for the recent shoutout on the podcast!

I realize you can make a much smaller app by simply calling MessageBox, but that's why I outlined what I deem to be the "minimum functionality". SonicMouse has come the closest so far at 1776!
Рекомендации по теме
Комментарии
Автор

Fun fact: Roller Coaster Tycoon was written in assembly. There was just a little bit of C code to glue the game into the Win32 API. To date, it's the only assembly program that I know which *deliberately* contains crashing. :)

CFSworks
Автор

It's only low enough level if you've hand stitched it into rope memory as they did on the apollo flight computer. All these fancy text editors, pah!

paulveitch
Автор

When I wrote some assembly code in the early 90s I wouldn't have imagined that one day I'd be seeing someone's screen with 753, 488, 695, 296 bytes of free space next to a 7, 292 bytes assembly code. Also: insane assembly coding skills displayed in the 21st century.

lxhon
Автор

Been programming for 3 years, it's amazing how Dave shows you what true mastery looks like while remaining incredible humble. Makes you think about what it really means to BE a programmer. You sir are an inspiring.

tristynspies
Автор

"As you know I wrote the Windows task manager." - That quote made me click the Subscribe button, you're one of my personal heros I never knew I had.

aarondewindt
Автор

Started a computer science course in 1966. At BU it was simply called programming, we used Dartmouth Timeshare BASIC. In my career the most sophisticated language I ever used was Pascal, GUI programming scared me. Recently, after retirement, I bought a few Raspberry PIs and learned Python. When I was at Digital Equipment Corp I taught their machine code and assembly language. All this has no value unless I want to start a YouTube channel. I love your videos Dave, they bring back a lot of memories.

BTW, my daughter was diagnosed with Autism but after years a tests it turned out to be CVI and I'm glad to say she's one of the few that has almost completely adapted out of the worst of it.

RodCleaves
Автор

Watching Dave livecode is as relaxing as watching Bob Ross paint.

I haven't done Win32 programming in over a decade, but this brought back some great memories.

TimLesher
Автор

7:06 Dave just casually flexing his typing speed :D

maxinatorify
Автор

From buying MS-DOS in a Retail Box, to watching the creation of the World’s Smallest Windows App, what a time to be alive!

Upgradeo
Автор

It is actually scary to see this video and think "oh, looks like he is just speeding it up a bit." But then you look at the webcam and realize he is really typing this fast.

This man would dominate typeracer

le
Автор

Even for a modern C++ programmer, this gives a lot of insight to how programming was in the early 90s/late 80s. The commenting work is also very good! Learned some stuff I never knew about Windows.

martysh
Автор

I also grew up in the '80s but I was in Louisiana. As you might expect, things were not great for a computer nerd during those days. I had my Commodore 64, banging out BASIC scripts, but I lacked resources or a mentor that could take me to the next level. My guidance counselors, who didn't understand computers, didn't encourage me to go down that path for a career. I literally thought you could be a scientist or work in a store. Retail is what I ended up doing for 10 years, though I was always building my own PCs. I finally broke into the IT support business and never looked back. Still can't code very well though. I wish I had focused on it more when I was young. So if you are a young person, or a parent of one, and your child shows an inclination to learn programming, by all means support them and try to encourage them to learn as much as they can.

billstrader
Автор

This makes people appreciate 4k demoscene intros even more.

pezia
Автор

You're a machine Dave. I've coding for 15 years and I can't still code that fast... impressive.

emmanueloverrated
Автор

Fascinating content, and Dave’s typing sounds like white noise since it’s so fast. That’s decades of time spent at a keyboard on display. Thanks for creating this!

SkarTisu
Автор

I emailed Dave the other day about the Windows Message Pump, and he replied within 2 hours. This channel is awesome!

schulmastery
Автор

Wow, I really enjoy this channel and learning so much from you Dave. This was the best Assembly 101 short course I ever been in.

wasekasi
Автор

Just found this channel. I have to say this now in my top 5 favorite channels to view. I see a flight full of downloaded Dave's videos. Well done sir. Glad to see we old nerds are still makin' it happen. This is also a great stroll down memory lane to coding in the 80's. Cheers

stargazersfield
Автор

Health nut: "I ran a 4K yesterday."
Dave: "Oh, what did it do?
Health nut: wha?

StringerNews
Автор

There's nothing more satisfying than building something from scratch and seeing it work! Thanks Dave!

xXFastDathXx