3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

How to write the world's smallest "Hello World!" executable for PC

Step 5Storing the Hello World executable to "hellow.com"

Storing the Hello World executable to "hellow.com"
«
  • helloworld50.gif
  • helloworld0.gif
Finally is the moment of trust! We will finally create our beloved smallest Hello World executable for PC!

To finish our app, type:

-n C:\hellow.com
-r BX
BX 0000
:0
-r CX
CX 0000
:15
-w
Writing 00015 bytes

Note that i've used 15 due for numeric values in DEBUG.EXE are threated as hexadecimals: 0x15 = 21 decimal
After writing, "hellow.com" file is created at C:\ !!!
You can change the filename and path of command "n" at your choice.
Before we terminate, let me explain what each command do:

"n" = Name (filename that will be used to load/save files into DEBUG's Memory)
"r" = Register (used to change register value, but while writing to file BX:CX it's used to specify the length to write)
"w" = Write to a file or to a sector on a disk if you specify the drive and the sector.

But let's not worry about "w" command being able to write directlly to a disk sector, if you just write "w (address)", nothing bad happens.
I wont teach you how to read/write to a sector but in case you want to read/write to a sector of a disk, use the Drive A (0) for experiments.
Don't try to modify the floopy disk boot image with this Hello World code because it won't work, INTR 21h is only installed when COMMAND.COM is executed.

To finish the tutorial, type:

-q

Then execute the "hellow.com" file!

C:\WINDOWS> cd C:\
C:\> hellow.com
Hello World!
C:\>

Congratulations! We have our Hello World executable created and running! :D
« Previous StepDownload PDFView All StepsNext Step »

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
0
Followers
1
Author:JustBurn