Your SlideShare is downloading. ×
  • Like
Assembler
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Now you can save presentations on your phone or tablet

Available for both IPhone and Android

Text the download link to your phone

Standard text messaging rates apply
Published

 

Published in Education
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
300
On SlideShare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
22
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. ASSEMBLER
  • 2. Assembler
  • 3. General Design Procedure:1. Specify the Problem2. Specify Data Structure3. Define Format of Data Structure4. Specify Algorithm5. Look for modularity6. Repeat 1 through 5 on modules
  • 4. Statement of problem
  • 5. Pass 1 purpose: Define symbols andliterals Determine length of machine instructions (MOTGET1) Keep track of location counter (LC) Remember values of symbols until pass 2 (STSTO) Process some pseudo ops, e.g. EQU, DS (POTGET1) Remember literals (LITSTO)
  • 6. Pass 2 purpose: Generate objectprogram Look up value of symbols (STGET) Generate instructions (MOTGET2) Generate data (for DS, DC and literals) Process pseudo ops(POTGET2)
  • 7. Data Structure Pass 1 data bases:1. Input source program2. A Location Counter (LC), used to keep track of each instruction’s location.3. A table, the Machine Operation Table (MOT), that indicates the symbolic mnemonics for each instruction and its length4. A table, the Pseudo Operation Table (POT), that indicates the symbolic mnemonics and action to be taken for each pseudo-op in pass 1
  • 8. Data Structure5. A table, the Symbol Table (ST), that is used to store each label and its corresponding value.6. A table, the Literal Table (LT), that is used to store each literal encountered and its corresponding assigned locations.7. A copy of the input to be used later by pass 2. this may be stored in a secondary storage device.
  • 9. Data StructurePass 2 data bases:1. Copy of source program input to pass 12. Location Counter (LC)3. A table, the Machine Operation Table (MOT), that indicates for each instruction: i) symbolic mnemonics ii)length iii)binary machine op code and iv) format4. A table, the Pseudo Operation Table (POT), that indicates for each pseudo op the symbolic mnemonics and the action to be taken in pass 2
  • 10. Data Structure5. The Symbol Table (ST), prepared by pass 1, containing each label and its corresponding value.6. A table, the Base Table (BT), that indicates which registers are currently specified as base registers by USING pseudo- ops and what are the specified contents of these registers.7. A work space, INST, that is used to hold each instruction as its various parts are being assembled together.
  • 11. Data Structure8. A workspace, PRINT LINE, used to produce a printing listing9. A workspace, PUNCH CARD, used prior to actual outputting for converting the assembled instructions into the format needed by the loader.10. An output deck of assembled instructions in the format needed by the loader.
  • 12. Format of Data Bases
  • 13. Format of Data BasesMachine-Op Table (MOT) for pass 1 and pass 2
  • 14. Format of Data BasesPseudo-Op Table (POT OR OPTAB) for pass1 and pass 2
  • 15. Format of Data BasesSymbol Table (ST OR SYMTAB) for pass 1 and pass 2
  • 16. Pass 1
  • 17. Pass 2
  • 18. Look for ModularitySome functions that may be isolated in Pass 1:
  • 19. Look for modularitySome functions that may be isolated in pass 21. READ22. POTGET23. MOTGET24. EVAL5. PUNCH6. PRINT7. DCGEN8. DLENGTH9. BTSTO10. BTDROP11. BTGET12. LTGEN