1. Define the basic functions of assembler.
* Translating mnemonic operation codes to their machine language equivalents.
* Assigning machine addresses to symbolic labels used by the programmer.
2. What is meant by assembler directives?
Give example. These are the statements that are not translated into machine instructions, but they provide instructions to assembler itself.
example START,END,BYTE,WORD,RESW and RESB
3. What are forward references?
It is a reference to a label that is defined later in a program.
Consider the statement
10 1000 STL RETADR
. . . . . . . .
80 1036 RETADR RESW 1
The first instruction contains a forward reference RETADR. If we attempt to translate the program line by line, we will unable to process the statement in line10 because we do not know the address that will be assigned to RETADR .The address is assigned later(in line 80) in the program.
4. What are the three different records used in object program?
The header record, text record and the end record are the three different records used in object program.
(i)The header record contains the program name, starting address and length of the program.
(ii)Text record contains the translated instructions and data of the program.
(iii) End record marks the end of the object program and specifies the address in the program where execution is to begin.
5. What is the need of SYMTAB (symbol table) in assembler?
The symbol table includes the name and value for each symbol in the source program, together with flags to indicate error conditions. Some times it may contain details about the data area. SYMTAB is usually organized as a hash table for efficiency of insertion and retrieval.
6. What is the need of OPTAB (operation code table) in assembler?
The operation code table contains the mnemonic operation code and its machine language equivalent. Some assemblers it may also contain information about instruction format and length. OPTAB is usually organized as a hash table, with mnemonic operation code as the key.
7. What are the symbol defining statements generally used in assemblers?
„EQU‟-it allows the programmer to define symbols and specify their values directly.
The general format is
Symbol EQU value „ORG‟-it is used to indirectly assign values to symbols. When this statement is encountered the assembler resets its location counter to the specified value. The general format is ORG value In the above two statements value is a constant or an expression involving constants and previously defined symbols.