Frequently asked questions for the VB-World Assembly Language forum.




This FAQ came about because people were asking the same questions over and over again in the assembly language forum. So we bugged John until he finally caved in and said if we write one, he'll post it. So here it is. It's still small, but it will grow as time goes on. This FAQ is mainly for the assembly language for MS-DOS, but if there's a question that is specific to another O/S and people ask it alot, let me know and I'll post it.
- Jake Bush

.General Questions

..How do I write an assembler program?

First you'll need an assembler, see below.


There are alot of assemblers, but for beginners I would suggest using the A86 assembler. It's free and very easy to use. It doesn't require all the different stuff an average assembler requires. It's for MS-DOS and will only assemble .com files, but it's perfect to learn with. Download it, unzip it and add the directory to the path.

...Hello World!

Now that you have an assembler, you'll want to write your first program. The first program people write is usually the "Hello World!" program, so we'll do the same. Create a file and name it "Hello.asm". Then type in the following code...

	jmp	start
Message1	db "Hello World!$"

	mov	ah, 09h
	mov	dx, offset Message1
	int	21h

	mov	ax, 4c00h
	int	21h
Then at the command line type...
a86 hello.asm
You should get "HELLO.COM". Run it and see what happens.

...What Now?

Now that you've written your first assembler program, you want to know what all that means. We'll for that you'll need to read an assembler tutorial, like this...
Gavin's Guide to 80x86 Assembly

..How Do I Get The Command Line?

The command line is loaded in the memory at offset 81h. The length of the command line is at 80h. So assemble this program with A86...

	mov	si, 81h
	mov	ah, 02h

	cmp	al, 0dh
	je	endload

	mov	dl, al
	int	21h

	jmp	nextbyte

This will print out the command line that you type when you run it.


Gavin's Guide to 80x86 Assembly
Ralf Brown's Interrupt List
The Art of Assembly Language Programming
Webster Assembly Language Programming Tools


Jake Bush -
To contibute to this FAQ contact Jake Bush.