Workshop Assembler
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

Workshop Assembler

on

  • 4,587 views

 

Statistics

Views

Total Views
4,587
Views on SlideShare
4,587
Embed Views
0

Actions

Likes
1
Downloads
93
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Workshop Assembler Presentation Transcript

  • 1. Lokmanya Tilak Jan Kalyan Shikshan Sanshtha’sWorkshop on“Improving Teaching Competencies”
    Lecture on the Topic:
    System Programming:Assembler
    Presented BY :
    Manoj S. Chaudhari
    Smt. Bhagwati Charturvedi College of Engg.
  • 2. Aim of the Lecture:
    To Study
    Assembler
    Structure of Assembly Language Program(ALP)
    Steps to Translate ALP to Machine Language Program
    Data Structure/Tables used by the assembler
    Two pass assembler
    Pass 1 Assembler
    Pass 2 Assembler
  • 3. Assembler:
    System Programs:
    Job is done more efficiently.
    Executes the programs effectively.
    e.g. Compiler , Interpreter
    • Assembler:
    A system program which translate ALP into
    its equivalent machine language.
    It is basically a translator.
  • 4. Structure of Assembly Language Program:
    ALP is a sequence of Assembly language statement.
    Each Assembly language statement consist of 4 fields:
    Label
    Opcode
    Operand
    Comment
    Consider the Assembly Language Statement:
    Loop MVI B, 05H ; move data 05H to register B
    Label Opcode Operand Comment
  • 5. Two Types of Opcodes:
    1.Pseudo- opcode
    2.Machine Opcode
    • Pseudo-Opcode
    e.g. USING , DC, DS
    • Machine Opcode
    e.g. ADD, MVI , DCR
    Types of Opcodes:
  • 6. Steps for Translating an ALP to Machine Language Code
    Translation is statement by statement basis .
    Read the assembly language statement and separate all the fields.
    Verify whether opcode is Machine opcode or Pseudo opcode.
    If Pseudo opcode , check the type of Pseudo opcode.
    If Machine opcode , obtain information about binary code , format and length of instruction.
    Process the operands.
    Increment the value of counter by length of the instruction.
  • 7. Data Structure/Tables used by Assembler:
    Following are the tables used by the assembler.
    1) Machine Opcode Table (MOT)
    2)Pseudo Opcode Table (POT)
    3)Symbol Table (ST)
    4)Base Register Table (BRT)
    5)Literal Table (LT)
  • 8. 1)Machine Opcode Table
    The table consist of the fields: Name of mnemonic i.e. machine opcode, equiv. byte opcode, format of instruction and length of instruction.
  • 9. 2)Pseudo Opcode Table(POT)
    This table consist of the fields :
    Name of Pseudo opcode
    Routine associated with the Pseudo Opcode
  • 10. 3)Symbol Table(ST)
    The symbol table keeps track of the symbols used in the ALP . It has the following fields .
    Name of symbol
    Value of symbol
    Type of symbol
  • 11. 4)Base Register Table
    This table keeps the track of registers which are used as base register.
    The table has the following format.
  • 12. 5)Literal Table
    The literal table keep list of all the literals used in the program.
    The table has the following format.
  • 13. Two Pass Assembler
    The entire process of translating an ALP to its equivalent machine language code is divided into two passes.
    1) Pass 1 Assembler.
    2)Pass 2 Assembler.
  • 14. Pass 1 Assembler
    The function of Pass 1 Assembler is :
    • To define and compute the value of symbols .
    • 15. Assigning and storing the addresses to literals.
    So output of pass 1 is Symbol table and Literal table.
    Processing of Pass 1 with :
    • Pseudo- opcodes:
    1)USING and DROP: No processing is done.
    2)EQU: Processed for evaluation of operands.
  • 16. Contd…..
    3)DC/DS: Processed for the allocation of storage and LC is updated.
    4)START: LC is incremented by the value of the operand.
    5)LTORG: Storage is assigned from the start of the program or from previous LTORG.
    6)END : Assembler allocates all the literals before going for pass 2.
    • Machine Opcode:
    Get the length of instruction . If label/literal is present enter it in LT/ST and increment LC .
  • 17. Pass 1 Data Bases:
    1)Input Source Program
    2) LC : Used to keep track of each instruction.
    3) MOT :Indicates Symbolic mnemonic for each instruction and its length.
    4)POT: Indicates Symbolic mnemonic and action to be taken for each Pseudo Opcode.
    5)ST: Store each label and its value.
    6)LT: Store each literal and its corresponding location.
    7)A Copy of input later used by pass2
  • 18. Pass 1 Assembler Flow Chart:
    USING DROP
    Found
    DC/DS
    not found EQU END
    Pass 1
    LC0
    A
    Read ALS
    X
    SearchPOT?
    Type of Pseudo Opcode
    Adjust LC to Proper Alignment
    E
    Search MOT
    Eval Operand field
    B
    C
    D
  • 19. yes
    no
    B
    C
    D
    E
    Llength
    LLength of data field
    Assign value to symbol in Label field
    Assign Storage Location to Literals
    Process Literals ,Enter in LT
    Onto Pass 2
    Any Symbol?
    Assign Current value of LC to Symbol
    LC=LC+L
    A
    Write ALS on file for Use by Pass 2
    X
  • 20. References:
    Textbook :
    1)“System Programming”, By J.J. Donovan.
    2)”System programming and Operating system”, By D. M. Dhadhere.
    3)”Concepts of Compiler design “,By Adesh K Pandey.