Assembly Programming, Intel 8086
By Example

Last Up date: 2005 October 5
Recent changes: Here is: A link to an older page I had about my favorite Assembler a few of the links there may be dead.
Started Sat 04-06-05

There are some things you need to program in Assembly Language

  1. Some detailed facts about: the Intel 8086 Architecture it's registers and instructions is a minimal description.
    A more complete description should be available, on the internet? If you find something you like let me know.
  2. An Assembler Program. I recommend: A86 by Eric Isaacson.
    A downloadable copy is free, but if you are serious I recommend you buy it and get the manual.
  3. A description of the operating system interrupt services.
    These are best described in older DOS reference manuals. Possibly also available on the internet??
  4. An ASCII plain text editor to create the programs.
    For starts you can use Windows Notepad.
  5. Debug program, this is available in Windows at the Command Line prompt.
    The command: DEBUG /? will get you a list of commands.

Hello World!

Anyone familiar with the Language "C" will recognize "Hello World!". It is a very short simple program that when executed does nothing but print out "Hello World!". Its' purpose was there, and is here: to verify your tools work; and you can use them. Yes, it is a worthless program, but you should still assemble and run it.

With today's "modern" C compilers you can expect an executable program in the order of 20 to 50 thousand bytes long. Following is the Program in Assembly. It creates a .COM executable file that is 21 bytes long.

main:   mov     dx,datas        ;DX=output start
        mov     ah,9            ;output to $
        int     021
        ret
datas:  db      "Hello World!$"

The easy way to get this program, or any other examples is to:

  1. Right Click in this page.
  2. Press "V" for View Source
    This will start Notepad with the HTML code for this page.
  3. Delete everything but the program, shown in the box above.
    It is near the bottom between the lines: <pre> and </pre>.
  4. Save it As: hello.8

If you have Eric's A86 assemble you can assemble it with:
a86 hello.8
Almost instantly it will create: "hello.com" and "hello.sym". The .sym file is used by Eric's Debug program, and for now we will not use it. You can delete it.

hello.com is a working program. If you enter:
hello
The program will execute.

Congratulations, you have assembled and executed a program!

No doubt you will find more useful things about Assembly Language programming on the internet. I would like to have a page of links to the work of others. When I get a page of good links I will have a link to it here.

Here is an explanation of Hello and some suggestions about using DEBUG to step through it, and some variants.

The next sample programs are: pan which converts Phone Alphabet to Numbers. And adult. Really, you should look at pan next! But, if you are curious you can see samples of what "adult" does


Contact me at:
My phone #'s
For comments call, or e-mail me. Go to My Home Page or TOP of this page.