Search This Blog

Monday, October 18, 2010

Assignment - 4 Macro and Macro Processors

1) Given the following macro definition :

MACRO

CLEARMEN &X, &N, &REG= AREG

LCL &M

&M SET 0

MOVER &REG, =’0’

.MORE MOVEM &REG, &X + &M

&M SET &M +1

AIF (&M NE N) . MORE

MEND

Show the contents of the data structures deployed by the macro-processor for the call.

CLEARMEN AREA, 10

2) Write the differences between formal parameters, keyboard parameters and actual parameters.

3) How expansion time variables are useful in Macro Definition? Explain with example:

4) Explain the entry format for the macro name table(MNT).

5) Discuss concept of macros. How are they expanded and what data structures are needed in processing macros?

6) In an assembly language program, a certain action is required at 10 places in the program. Under what conditions would you code this action as

(a) A macro?

(b) A Subroutine?

7) Explain in detail how nested macro calls are processed by the macro preprocessor.

8) What is a macro? Given the following macro show all the data structure entries during macro definition and call.

MACRO

CLEAR &A, &B, &R = BREG

LCL &Z

&Z SET 5

MOVER &R, 0

.MORE MOVEM &R, &A + &Z

&Z SET &Z + 1

AIF (&Z NE &B). MORE

MEND

9) Write a macro which takes A, B, C and D as parameters and calculates (A*B*C*D) in the accumulator.

10) Draw flow-chart or write algorithm for one pass macro Pre-processor. Which type of modifications would you apply to convert your flow-chart or algorithm so that it should provide the facilities of Macro Assembler.

Assignment - 3 Assemblers

1) Discuss the problems encountered during single pass assembly. Suggest the alternative method clearly.

2) Draw the flowchart or state the algorithm of PASS-I of the assembler and explain it.

3) Describe the architecture of 8088 microprocessor in detail.

4) Given the following program:

START 300

ID1 DS 5

L1 MOVER AREG, D

ADD AREG, C

SUB AREG, ID2

MOVEM AREG, ID1

D EQU ID2

L2 PRINT D

ORIGIN ID1-1

C DC ‘9’

ORIGIN L2+1

STOP

ID2 DC ‘13’

END L1

Show the contents of symbol table and intermediate code at the end of pass-1.

5) Explain following assembler directives:

i) ORIGIN ii) EQU iii) EXTERN

6) Comparison between 2-pass assembler and 1-pass assembler


7) The following program is FED to the assembler

START 500

WX DS 5

K1 LOAD YY

ADD MM

STORE PP

PP EQU WX+1

K2 PRINT PP

ORIGIN WX+2

MM DC ‘8’

ORIGIN K2 +1

STOP

YY DC ‘35’

END

i. Show the content of the symbol table at the end of pass 1.

ii. Explain the significance of EQU and ORIGIN statements in the above program and explain how they are processed by the assembler.

8) Explain different addressing modes of 8088 processor with example.

9) What do you mean by forward reference? How single pass translation and multipass translation take care of forward- reference?

10) Explain data structures used by pass-I of the assembler with example.

11) Write short note on LTORG statement processing

12) Write short note on Assembler Directive and Imperative Statements.