MAKE
Three programs, built by the assembler sitting on the same
disk. Nothing was downloaded to do it.
HEX HELLO.COM
HELLO
Eighteen bytes, all of them on one line. That file has no
header: DOS loads it and jumps straight to the first byte.
HEX HELLO.COM 12 WORLD
HELLO
Without assembling anything. The source still says HELLO.
The program does not.
HEX HELLO2.EXE
The same program with a header, a relocation table and a
stack of its own — 81 bytes to do what 18 did.
The second lesson of the series, with the machine attached. Everything you need is already in the tab: three assembly sources, the assembler that builds them, and a DOS to run the result on. Nothing is installed and nothing is downloaded. Reload the page and you get a fresh machine with the sources back as they were, so there is nothing you can break.
Type HELP at any point and the machine prints the list again.
0000: BA 0C 01 B4 09 CD 21 B8 00 4C CD 21 48 45 4C 4C ......!..L.!HELL 0010: 4F 24 O$
Twelve bytes of instructions, then the word itself. BA 0C 01
is put 010Ch into DX — the address of the text, and 010Ch is
where the text landed because a COM file starts at offset 100h. That is why
the patch in step 3 writes at offset 12: it is the first letter, and
it is simply lying there in the file.
If you would rather change the source than the finished program:
EDIT HELLO.ASM
That opens flat assembler's own DOS editor. Change the text, save with F2, leave with Esc, and type MAKE again.
The recorded lesson uses one to look at the bytes. It could not come with you: that program is shareware, free to use and not free to hand out, and this page is meant to be opened by somebody who agreed to nothing and downloaded nothing. So the byte viewer you are using is a program of ours, written in the language this lesson is about and built by the assembler this lesson uses — and you rebuilt it yourself when you typed MAKE.
the lesson's sources and notes · back to the arcade · the assembler is flat assembler, and the DOS is DOSBox compiled to WebAssembly via js-dos