As time has marched on, it's a little bit tricky to produce code that will run on a raw 8086, as used in our lab. Luckily Microsoft has left enough scraps of their assembler laying around for public use that one can cobble together a (legal!) solution. Of course this won't help you test your code for the labs where you have to interface with the various chips and devices on the board, but it's helpful if your code at least compiles when you come to the lab.
UPDATE: Check the Problems section for info on common issues.
The maintenance of the 32-bit verison of MASM has been taken over by groups on the internet, as Microsoft has largely discontinued active development.
MASM32 can be obtained here. Note the very
first link is the Canadian mirror. Extract the file and run install.exe
, which will
install an editor and many extra libraries for 32-bit Windows assembly coding on your system,
most of which we are not interested in.
The important files will be in c:\masm32\bin
. MASM.exe
has been renamed
ML.exe
at some point over the years, and is the assembler executable. LINK.exe
is still the linker, but we need to replace it with a 16-bit linker in order to generate code
appropriate for the board in the labs.
A 16-bit linker can be
downloaded from Microsoft. It will extract three files when executed, the important one being
LINK.exe
. Copy this into c:\masm32\bin
. If you want to retain the option of
using the 32-bit linker, rename it to LINK32.exe
or similar before overwriting it.
The simplest thing to do is just copy ML.exe
and LINK.exe
into the directory
you want to work in. You can try using the QEditor GUI provided in the install package, but we can't
help you if you have problems. So, assuming you're working from the command line in a directory containing
the two executables and your source files, here are some things you'll need to know:
.8086
at the top, in order
to create only instructions for the 8086. (Note, this may change slightly for Lab 4, we'll
let you know)./Zm
. If you encounter further
problems with reserved words (note: LOOP and STR are reserved), please use a different label. This will most often manifest itself as a error A2008: syntax error
ml.exe /Zm filename.asm
/c
, as in:
ml.exe /Zm /c filename.asm
/Flfilename.lst
, as in:
ml.exe /Zm /Flfilename.lst /c filename.asm
/Fl
for ML.exe
is an upper-case "F" followed
by a lower-case "L". Make sure you're not using the numeral "1" or an upper-case "I".0FFFFh
) in an
8-bit register (e.g. AL
). For example the code fragment:
test EQU 0FFFFh
MOV AL, test
ML.exe
can handle long file names (files with more than
8 characters before the period and 3 after, e.g. IamalongFileName.test
),
whereas LINK.exe
cannot. So keep your .asm
names to something like shrtname.asm