Assembler is a program which is used for converting mnemonics into machine code. For more explanation refer “Systems programming and operating systems By Dhamdhere “book. Here i have given very simple example to understand the Intel 8085 two pass assembler.
General Functions of an assembler
Pass one
- Assign addresses to all statements in source code
- Save values (addresses) assigned to labels for use in pass two
- Process directives
Pass two
- Translate instructions
- Convert labels to addresses
- Generate values defined by BYTE and WORD
- Process the directives not done in pass one
- Write object code to output device
Sample Program : Addition of two numbers
Sample Data (In Hex Format):
Source program
Pass1 :
a) Symbol Table : NIL
b) Literal Table
c) Opcode / Mnemonics Table
Pass2:
1. Generating Hexadecimal / Object Code
2. Machine Code
No comments:
Post a Comment