Professional Documents
Culture Documents
Assembly language programming tools :Software tools are used for editing, assembling, linking,
and debugging assembly language programming. These tools are briefly explained below.
Editor :
1. It is software which allows you to type and edit assembly language program statements.
2. It enables you to create, edit, save ,copy and make modification in the source file.
3. The file created in editor is an ASCII format and is known as source file.
4. You can use NotePad , Norton editor,Dos editor (EDIT) any other editor that produces plain ASCII text
files. You can also use the ConTEXT editor.
1. It is programming tool.
2. It is used for tracing/locating and correcting errors.
3. It allows the execution of .EXE program in single step mode under the control of user.
Page 1
Assembler directives :
These are the statements that direct the assembler to do something.
They indicate how an operand is treated by the assembler and how assembler handles the program.
They also direct the assembler how program and data should be arranged in the memory.
They do not generate any machine code.
Directives are classified into following categories.
1) Data definition and storage allocation directives
2) Program organization directives
3) Value returning attribute directives
4) Data control directives
5) Procedure directives
6) Macro directives
Data definition and storage allocation directives :
Data definition directives are used to define the program variable and allocate a specified amount of memory
to them. They are as follows;
1) DB(Define data Byte) - DB directive is used to declare a byte type. Variable size of variable is 1 byte.
General form :
Name_Of_VaribleDBInitialiation_value(,s)
2) DW (Define data Word) - The DW directive is used to define a variable of type word. Variable size of
variable is 2 byte.
General form :
Name_Of_VaribleDW Initialiation_value(,s)
Page 2
General form :
Name_Of_Varible DDInitialiation_value(,s)
General form :
Name_Of_Varible DQInitialiation_value(,s)
General form :
Structure_Name STRUCT
………………..
………………..
………………..
………………..
Structure_NameENDS
7) EQU (Equate to) - This EQU directive is used to give a name to some value or to a symbol. Each time
the assembler finds the name in the program, it will replace the name with the value or symbol you given
to that name.
General form :
Symbol_Name EQU eXPRESSION
Example: FACTOR EQU 03H
8) EVEN –Align as even memory location : This EVEN directive is used to inform the assembler to
increment the location counter to the next even memory address if it is not already in the even address.
General Form:
EVEN
Example : DATA SEGMENT
Page 3
Name db ‘xyz’
EVEN
Age db 20
DATA ENDS
9) ALIGN :Alignment of memory addresses:
The directive ALIGN is used to force the assembler to align the next data item or instruction
according to given value.
General Form:
ALIGN Numeric_value
The number must be a power of 2 such as 2,4,8,16.
Example :
ALIGN 4
10) ORG-Originate : The directives ORG assigns the location counter with the value specified in the
directive. It helps in placing the machine code in the specified location while translating the
instructions into machine codes by the assembler.
General Form:
ORG Numeric_value
Example:
ORG 100H
2) SEGMENT and ENDS directives: They are used to mark the beginning and end of the particular
segment.
Page 4
7) .MODEL :Memory model declaration for segments : This simplified segment directive creates
default segments.
General Form:
.MODEL memory_models
Memory models are
.SMALL : All data in one segment and all code in one segment.
.MEDIUM: All data in one segment but code in more than one segment.
.COMPACT : Data in more than one segment but code in one segment.
.LARGE : both data and code in more than one segment, but no array may exceed 64 kbytes.
.HUGE : both data and code in more than one segment, but array may exceed 64 kbytes.
5) GLOBAL :The labels, variables, constants or procedures declared GLOBAL may be used by other
modules of the program. Once a variable is declared GLOBAL, it can be used by any module in
the program. The following statement declares the procedure ROUTINE as a global label.
ROUTINE PROC GLOBAL
File Inclusion Directives:
INCLUDE - This INCLUDE directive informs the assembler to include the statement defined in the include
file. The name of the include file follows the statement INCLUDE.
General form: INCLUDE <file path specified with file name>
Example : INCLUDE C:\TASM\MACRO.LIB
INCLUDE C:\TASM\MYPROC.LIB
Page 6