Assemblers
Prof Nirali Arora
Assembler
Assembler is a language translator that accepts an assembly language program as input
and produces its machine language equivalent as output along with the information required
by the loader.
Features of Assembly language
1. Faster in speed as it will be extremely optimized to use only necessary
resources.
2. Efficient use of memory
3. High level of control of hardware operations.
4. Access registers and memory in hardware which cannot be accessed while
using high level languages.
5. Don’t need to rely on compilers to optimize the code.
Format of assembly language
Syntax of Assembly Language Statements
Assembly language statements are entered one statement per line. Each statement follows the
following format −
[label] mnemonic [operands] [;comment]
Structure of ALP statement
Label: It is used to assign symbolic names to the memory location.
Mnemonic: This is a human readable keyword for binary opcode of an instruction.
Operands: Are the data on which the instruction operates on.Operands may be direct values
or symbolic references to stored data.
The primary function of the assembler is to replace the mnemonic with its binary opcode and
replace operand symbols and literals with storage addresses.
Comments are used to understand the code
Literals
Literals:
Symbols:
Procedures:
Types of ALP statements
Assembler directive statements
Declarative statements
Imperative statements
Assembler directive statements: These statements direct the assembler to take action
associated with it.
Assembler directive statements
What are assembler diirective statements?
Explain Declarative statements?
Explain imperative statements?
Features of ALP
Use of mnemonics to specify opcodes makes the assembly language program more
readable and easier to debug.
Use of symbols to specify operands means that program can be modified with no overhead.
Separation of code and data segments allows the programmer to keep some portion oif the
memory for data to be used by the program..

Assemblers .pdf.pptx

  • 1.
  • 2.
    Assembler Assembler is alanguage translator that accepts an assembly language program as input and produces its machine language equivalent as output along with the information required by the loader.
  • 3.
    Features of Assemblylanguage 1. Faster in speed as it will be extremely optimized to use only necessary resources. 2. Efficient use of memory 3. High level of control of hardware operations. 4. Access registers and memory in hardware which cannot be accessed while using high level languages. 5. Don’t need to rely on compilers to optimize the code.
  • 4.
    Format of assemblylanguage Syntax of Assembly Language Statements Assembly language statements are entered one statement per line. Each statement follows the following format − [label] mnemonic [operands] [;comment]
  • 5.
    Structure of ALPstatement Label: It is used to assign symbolic names to the memory location. Mnemonic: This is a human readable keyword for binary opcode of an instruction. Operands: Are the data on which the instruction operates on.Operands may be direct values or symbolic references to stored data. The primary function of the assembler is to replace the mnemonic with its binary opcode and replace operand symbols and literals with storage addresses. Comments are used to understand the code
  • 6.
  • 7.
    Types of ALPstatements Assembler directive statements Declarative statements Imperative statements Assembler directive statements: These statements direct the assembler to take action associated with it.
  • 8.
    Assembler directive statements Whatare assembler diirective statements?
  • 9.
  • 10.
  • 11.
    Features of ALP Useof mnemonics to specify opcodes makes the assembly language program more readable and easier to debug. Use of symbols to specify operands means that program can be modified with no overhead. Separation of code and data segments allows the programmer to keep some portion oif the memory for data to be used by the program..