You are on page 1of 1

What is the need for an assembler directive?

In addition to translating the instructions of the source program, the assembler must process statements called assembler directives or pseudo-instructions. These statements are not translated into machine instructions. Instead, they provide instructions to the assembler itself. Examples: 1. BYTE and WORD direct the assembler to generate constants as part of the object program. 2. 3. 4. RESB and RESW instruct the assembler to reserve memory locations without generating data values. START specifies the starting memory address for the object program. END marks the end of the program.

What is the use of location counter? LOCCTR is initialized to the beginning address specified in the START statement. After each source statement is processed, the length of the assembled instruction or data area to be generated is added to LOCCTR. Thus whenever we reach a label in the source program, the current value of LOCCTR gives the address to be associated with that label. What does an assembler perform when it encounters LTORG assembler directive. When the assembler encounters a LTORG statement, it creates a literal pool that contains all of the literal operands used since the previous LTORG (or the beginning of the program). This literal pool is placed in the object program at the location where the LTORG directive was encountered. Write down the pass numbers either (Pass 1 or Pass 2) of the following activities that occur in a 2-pass assembler. i) object code generation ii) Literals added to literal table iii) Printing assembly listing iv) address resolution of local symbols List the types of assembler 1. 2. 3. one pass assembler two pass assembler multipass assembler. -

How can the assembler overcome the problem of forward reference? The assembler overcome the problem of forward reference through two pass and multipass assemblers. The first pass does little more than scan the source program for label definitions an assign addresses. The second pass performs most of the actual translation previously described.

You might also like