Assembler Functions and Two-Phase Translation
Classified in Computers
Written on in
English with a size of 2.83 KB
Functions of an Assembler
The fundamental task of an assembler is to translate a program in assembly language to code for machine language. In essence, the assembler must perform the following tasks:
- Convert the code (opcode or mnemonic: e.g., LDA, STX) to the equivalent code in machine language.
- Convert symbolic operands (tags or variables) into the addresses of the operands.
- Build the machine language instructions in the appropriate format.
- Convert the constants defined in the program into their true representation.
- Write the "listing" in assembly language to machine language code.
- Process the assembly guidelines. The guidelines are instructions or commands directed to the assembler, which it processes and executes as it encounters them in the assembly