2. CONTENTS
• What is Assembly language?
• Assembly language statements
• Data allocation
• Symbol Table
• Addressing mode
3. WHAT IS ASSEMBLY LANGUAGE?
• Assembly Language is a low-level programming language. It helps in
understanding the programming language to machine code.
4. ASSEMBLY LANGUAGE STATEMENTS
• Assembly language programs are created out of three different classes of
statements.
1. Executable instructions
2. Assembler directives
3. Macros
5. DATA ALLOCATION
• In the assembly language, allocation of storage space is done by the define
assembler directive.
• The define directive can be used to reserve and initialize one or more bytes.
• The general format of the storage allocation statement for initialized data is
variable-name define-directive initial-value [,initial-value],· ·
• The square brackets indicate optional items. The variable-name is used to identify
the storage space allocated.
6.
7. DATA ALLOCATION
• The define directive takes one of the five basic forms:
• DB Define Byte ; allocates 1 byte
• DW Define Word ; allocates 2 bytes
• DD Define Doubleword ; allocates 4 bytes
• DQ Define Quadword ; allocates 8 bytes
• DT Define Ten Bytes ; allocates 10 bytes
8.
9.
10.
11.
12.
13. ADDRESSING MODE
• There are four type of Addressing Mode
1. Register Addressing Mode
2. Immediate Addressing Mode
3. Direct Addressing Mode
4. Indirect Addressing Mode
14. REGISTER ADDRESSING MODE
• In this addressing mode, processor’s internal registers contain the data to be
manipulated by the instruction. For example,
mov EAX,EBX
• Note that The contents of EBX are not destroyed and the original contents of EAX
are lost.
• Register-addressing mode is the most efficient way of specifying data because
the data are within the processor and, therefore, no memory access is required.
15. IMMEDIATE ADDRESSING MODE
• In this addressing mode, data are specified as part of the instruction itself. As a
result, even though the data are in memory, it is located in the code segment, not
in the data segment.
mov AL, 75
16. DIRECT ADDRESSING MODE
• Operands specified in a memory-addressing mode require access to the main
memory, usually to the data segment.
• In the direct addressing mode, the offset value is specified directly as part of the
instruction. In an assembly language program, this value is usually indicated by
the variable name of the data item.
• The assembler will translate this name into its associated offset value during the
assembly process. To facilitate this translation, the assembler maintains a symbol
table.
17.
18. INDIRECT ADDRESSING MODE
• In this addressing mode, the offset or effective address of the data is in one of the
general registers. For this reason, this addressing mode is sometimes referred to
as the register indirect addressing mode.
• The indirect addressing mode is not required for variables having only a single
element. But for variables like table1 containing several elements.
• the starting address of the data structure can be loaded into a register and then
the register acts as a pointer to an element in table1. By manipulating the
contents of the register, we can access different elements of table1.