ASSEMBLER
WHAT IS ASSEMBLER? An assembler is a program that converts an assembly level language code (also called as mnemonic code) into machine language code and provides necessary information for the loader to load the programme.
Assembler languages-structure Label symbolic labeling of an assembler address (command address at Machine level) Mnemomic Symbolic description of an operation Operands Contains of variables or addresse if necessary Comments ignored by assembler used by humans to document/understand programs tips for useful comments: avoid restating the obvious, as “decrement R1” provide additional insight, as in “accumulate product in R6” <Mnemomic> <Operand> Comments <Label>
TYPES OF STATEMENT OF ASSEMBLER STATEMENTS IMPERATIVE  STATEMENTS DECLARATIVE  STATEMENT ASSEMBLER DIRECTIVE STATEMENTS
ASSEMBLER PROCESS ASSEMBLY LANGUAGE PROGRAM PASS1 PASS2 EXECUTABLE  IMAGE SYMBOL TABLE First Pass: scan program file find all labels and calculate the corresponding addresses; this is called the  symbol table Second Pass: convert instructions to machine language, using information from symbol table
OVERVIEW PASS1
PASS 2 Overview: Evaluate Fields and Generate Code.
Assembler’s functions Convert mnemonic  operation codes  to their machine language equivalents Convert symbolic  operands  to their equivalent machine addresses . Build the machine instructions in the proper  format Convert the  data constants  to internal machine representations Write the  object program  and the assembly listing
Linking and Loading Loading  is the process of copying an executable image into memory. more sophisticated loaders are able to  relocate  images to fit into available memory must readjust branch targets, load/store addresses Linking  is the process of resolving symbols between independent object files. suppose we define a symbol in one module, and want to use it in another some notation, such as  . EXTERNAL , is used to tell assembler that a symbol is defined in another module linker will search symbol tables of other modules to resolve symbols and complete code generation before loading
DATABASES USED BY PASS1 AND PASS2
ADVANTAGES It used mnemonics instead used bits. Address are symbolic not absolute. Reading / understand program easily. Introduction to data is easier.
DISADVANTAGES  Working with assembler takes a little more time, through not as much as people are wont to think. Assembler offers more facilities for structuring, even though lacking craftsmanship will bring on maintenance problems more easily. In assembler one has more possibilities for solving or preventing performance problems. It takes some extra effort to find or train professionals.
 

Assembler

  • 1.
  • 2.
    WHAT IS ASSEMBLER?An assembler is a program that converts an assembly level language code (also called as mnemonic code) into machine language code and provides necessary information for the loader to load the programme.
  • 3.
    Assembler languages-structure Labelsymbolic labeling of an assembler address (command address at Machine level) Mnemomic Symbolic description of an operation Operands Contains of variables or addresse if necessary Comments ignored by assembler used by humans to document/understand programs tips for useful comments: avoid restating the obvious, as “decrement R1” provide additional insight, as in “accumulate product in R6” <Mnemomic> <Operand> Comments <Label>
  • 4.
    TYPES OF STATEMENTOF ASSEMBLER STATEMENTS IMPERATIVE STATEMENTS DECLARATIVE STATEMENT ASSEMBLER DIRECTIVE STATEMENTS
  • 5.
    ASSEMBLER PROCESS ASSEMBLYLANGUAGE PROGRAM PASS1 PASS2 EXECUTABLE IMAGE SYMBOL TABLE First Pass: scan program file find all labels and calculate the corresponding addresses; this is called the symbol table Second Pass: convert instructions to machine language, using information from symbol table
  • 6.
  • 7.
    PASS 2 Overview:Evaluate Fields and Generate Code.
  • 8.
    Assembler’s functions Convertmnemonic operation codes to their machine language equivalents Convert symbolic operands to their equivalent machine addresses . Build the machine instructions in the proper format Convert the data constants to internal machine representations Write the object program and the assembly listing
  • 9.
    Linking and LoadingLoading is the process of copying an executable image into memory. more sophisticated loaders are able to relocate images to fit into available memory must readjust branch targets, load/store addresses Linking is the process of resolving symbols between independent object files. suppose we define a symbol in one module, and want to use it in another some notation, such as . EXTERNAL , is used to tell assembler that a symbol is defined in another module linker will search symbol tables of other modules to resolve symbols and complete code generation before loading
  • 10.
    DATABASES USED BYPASS1 AND PASS2
  • 11.
    ADVANTAGES It usedmnemonics instead used bits. Address are symbolic not absolute. Reading / understand program easily. Introduction to data is easier.
  • 12.
    DISADVANTAGES Workingwith assembler takes a little more time, through not as much as people are wont to think. Assembler offers more facilities for structuring, even though lacking craftsmanship will bring on maintenance problems more easily. In assembler one has more possibilities for solving or preventing performance problems. It takes some extra effort to find or train professionals.
  • 13.