Experiment No.
AIM:- INTRODUCTION TO MASM PROGRAMMING
The microprocessor development system consists of a set of hardware and software
tools. The hardware of development systems usually contains a standard PC
(Personal Computer), printer and an emulator. The software tools are also called
program development tools and they are Editor, Assembler, Library builder,
Linker, Debugger and Simulator. These software tools can be run on the PC in
order to write, assemble, debug, modify and test the assembly language programs.
EDITOR (TEXT EDITOR):
The Editor is software tool which, when run on a PC, allow the user to type/enter
and modify the assembly language program. The editor provides a set of
commands for insertion, deletion, modifications of letters, characters, statements,
etc., The main faction of an editor is to help the user to constrict the assembly
language program in the right format. The program created using editor is known
as source program and usually it is saved with file extension “ASM”.
ASSEMBLER:
The assembler is a software tool which run on a PC, converts the assembly
language program to machine language program. Several types of assemblers are
available and they are one pass assembler, two pass assembler, macro assembler,
cross assembler, resident assembler and Meta assembler.
One Pass Assembler: In the one pass assembler source code is processed only
once, and we can use only backward reference.
Two Pass Assembler: Most of the popularly used assemblers are two pass
assembler. In two pass assembler, the first pass is made through source code for
the purpose of assigning an address to all the labels and to store this information in
a symbol table. The second pass is made to actually translate the source code into
machine code.
Some examples of assemblers are TASM (Borland’s Turbo Assembler), MASM
(Microsoft Macro Assembler), ASM86 (INTEL’S 8086 Assembler), etc,.
MASM:
The Microsoft Macro Assembler (abbreviated MASM) is an x86 high-level
assembler for DOS and Microsoft Windows. Currently it is the most popular x86
assembler. It supports a wide variety of macro facilities and structured
programming idioms, including high-level functions for looping and procedures.
Later versions added the capability of producing programs for Windows. MASM is
one of the few Microsoft development tools that target 16-bit, 32-bit and 64-bit
platforms. Earlier versions were MS-DOS applications. Versions 5.1 and 6.0 were
OS/2 applications and later versions were Win32 console applications. Versions
6.1 and 6.11 included Phar Lap’s TNT DOS extender so that MASM could run in
MS-DOS.
MASM can be used along with a link program to structure the codes generated by
MASM in the form of an executable file. This assembler reads the source program
as its inputs and provides an object file. The link accepts the object file produced
by this MASM assembler as input and produces an EXE file.
      The effective execution of a program in assembly language we need the
following
      1. MASM assembler
      2. NE (Norton’s Editor) editor (or) Edlin editor
      3. Linker
      4. Debug utility of DOS
LIBRARY BUILDER:
      The library builder is used to create library files which are collection of
procedures of frequently used functions.
      The input to library builder is a set of assembled object of program
modules/procedures.
      The library builder combines the program modules/procedures into a single
file known as library file and it is saved with file extension “.LIB”. Some examples
of library builder are Microsoft’s LIB Borland’s TLIB, etc,.
LINKER:
      The linker is a software tool which is used to combine releasable object files
of program modules and library functions into a single executable file.
      The linker also generates a link map file which contains the address
information about the linked files.
      Some examples of linkers Microsoft’s linker LINK, Borland’s Turbo linker
TLINK, etc,.
DEBUGGER:
      The debugger is a software tool that allows the execution of a grogram in
single step or break-point mode under the control of user. The process of locating
and correcting the errors in a program using a debugger is known as debugging.
      The debugger tools can help the user to isolate a problem in the program.
Once the problem/errors are identified, the algorithm can be modified. Then the
user can the editor to correct the source program, reassemble the corrected source
program, relink and run the program again.
SIMULATOR:
      The simulator is a program which can be run on the development system
(Personal computer) to simulate the operations of the newly designed system.
      Some of the operations that can be simulated are given below.
       Execute a program and display result.
       Single step execution of a program.
       Break – point execution of a program.
       Display the contents of register/memory.
RESULT: Thus we have studied about MASM.