Using the 8088 Assembler

Installing the Assembler

If you don't already have access to an assembler for the Intel 8088 you can download an archive file containing a free assembler, valarrow.zip (about 107 kB). You'll need a utility such as unzip to extract the assembler files on a DOS PC. The only two files you need to keep are ASM.EXE and VAL.EXE.

You can also use any assembler (e.g. MASM or TASM) that uses standard Intel mnemonics and operand syntax.

Using the Assembler

Use a text editor (for example, the DOS EDIT program) to create the assembly language file. Use a file type (extension) of .asm. To assemble your program into an object (.obj) file use the command (assuming the file name is asg2.asm):
        asm asg2;
If it assembles without errors you can "link" it into an executable MS-DOS "COM" (.com) file using the command:
        val /co asg2;
(the /co option is required). Then you can run the program by typing
        asg2

Assembler Directives

Add the following 3 lines before your code:
code    segment public          ; (1)
        assume  cs:code,ds:code ; (2)
start:  org     100h            ; (3)
and the following 2 lines at the end of your code:
code    ends                    ; (1)                           
        end     start           ; (3)
These assembler directives: (1) tell the linker that the object file contains executable code, (2) tell the assembler how the segment registers will be set up when the program is loaded, and (3) make sure the executable code is assembled to run at the appropriate location (100H) within the code segment.

When DOS executes (runs) a .COM file, it loads the code into memory, sets the DS and CS segment registers to the start of the segment, sets SS to the top of the 64k segment and calls the code at location CS:100H.

Your code should terminate using the instruction

        int     20h
to return control to DOS
EECE 379 Home Page