Single pass assembler

53,592 views

Published on

Published in: Technology
2 Comments
48 Likes
Statistics
Notes
  • Don't you find any other better font??
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • i wanted to download it but....
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total views
53,592
On SlideShare
0
From Embeds
0
Number of Embeds
27
Actions
Shares
0
Downloads
0
Comments
2
Likes
48
Embeds 0
No embeds

No notes for slide

Single pass assembler

  1. 1. SINGLE PASSASSEMBLER
  2. 2. What is an assembler? A language translator which takes assembly language programming as i/p and produces a m/c equivalent code and information to the loader.Types• Two pass assembler• Single pass assembler
  3. 3. SINGLE PASS ASSEMBLER A single pass assembler scans the program onlyonce and creates the equivalent binary program.The assembler substitute all of the symbolicinstruction with machine code in one pass.
  4. 4. FORWARD REFERENCE PROBLEM• Rules for an assembly program states that the symbol should be defined somewhere in the program.• But in some cases a symbol may be used prior to its definition. Such a reference is called forward reference.• Due to this assembler cannot assemble the instructions and such a problem is called forward reference problem .
  5. 5. ASSEMBLER DIRECTIVES ORG: Manipulating L.C. SEGMENT: start of segment ENDS: end of segment ASSUME: tells the assembler it can ‘assume’ the address of the indicated segment
  6. 6. DATASTRUCTURES• Machine Opcode Table (MOT)• Segment Register Table (SRTAB)• Stored Segment Register Table (STSRT)• Symbol Table (SYMTAB)• Forward Reference Table (FRT)• Cross Reference Table (CRT)
  7. 7. FORMAT OF DATABASES• Machine opcode tableMNEUMONIC MACHINE FORMAT INFO ROUTINE IDOPCODE OPCODE
  8. 8. FORMAT OF DATABASES• Segment register table SEGMENT SEGMENT NAME REGISTER
  9. 9. FORMAT OF DATABASES• Stored segment register table SEGMENT SEGMENT NAME REGISTER
  10. 10. FORMAT OF DATABASES • Symbol Table Symbol  Owner segment EQU  Length Segment name  Size Defined  Source statement Type  Pointer to first FRT Offset in segment  Pointer to first CRT  Pointer to last CRT
  11. 11. FORMAT OF DATABASES• Forward reference tablePOINTER SRTAB # INSTRUCTION USAGE CODE SOURCE ADDRESS STATEMENT
  12. 12. FORMAT OF DATABASES• Cross reference table POINTER SOURCE STATEMENT #
  13. 13. SAMPLE PROGRAM
  14. 14. FLOW CHART
  15. 15. SAMPLE PROGRAM
  16. 16. DifferenceTwo pass assembler Single pass assembler• Performs two passes. • Performs single pass.• In first pass it collects the • In first pass itself its labels and symbols and collects the symbols and in second pass it labels and assemblels the assemblels the instruction. instruction.• It stores mneumonics and • It stores all mneumonics pseudocodes separately and pseudocodes in a i.e. MOT and POT single table MOT itself. respectively. • All entries for symbols• Literals and symbols are and literals are entered stored in symbol and into symbol table only. literal table respectively.
  17. 17. REFERENCES• http://en.wikipedia.org/wiki/Assembler_(computi ng)#Assembler• http://stackoverflow.com/questions/10244422/ho w-is-2-pass-assembler-different-from-one-pass- assembler-in-resolving-the-futur• http://it.becs.ac.in/content/chandan_giri/sp2- 4.pdf
  18. 18. THANK YOU!!!

×