Assembler

563 views
406 views

Published on

Published in: Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
563
On SlideShare
0
From Embeds
0
Number of Embeds
11
Actions
Shares
0
Downloads
29
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Assembler

  1. 1. ASSEMBLER
  2. 2. Assembler
  3. 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. 4. Statement of problem
  5. 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. 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. 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. 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. 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. 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. 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. 12. Format of Data Bases
  13. 13. Format of Data BasesMachine-Op Table (MOT) for pass 1 and pass 2
  14. 14. Format of Data BasesPseudo-Op Table (POT OR OPTAB) for pass1 and pass 2
  15. 15. Format of Data BasesSymbol Table (ST OR SYMTAB) for pass 1 and pass 2
  16. 16. Pass 1
  17. 17. Pass 2
  18. 18. Look for ModularitySome functions that may be isolated in Pass 1:
  19. 19. Look for modularitySome functions that may be isolated in pass 21. READ22. POTGET23. MOTGET24. EVAL5. PUNCH6. PRINT7. DCGEN8. DLENGTH9. BTSTO10. BTDROP11. BTGET12. LTGEN

×