You are on page 1of 1

1. Perform macro expansion on the following piece of code.

Explain the
process of macro expansion in your own words and generate the final
code after macro expansion.

2. Perform macro expansion on the following piece of code. Explain the


process of macro expansion in your own words and generate the final
code after macro expansion.
MACRO
COMPUTE &X, &Y=, &Z=AREG, &T
MOVER &Z, &X
MOVER &Z, &Y
MUL &Z, &X
ADD &Z, &T
SUB &Z, &Y
MOVEM &Z, &T
MEND
START 400
READ A, B, C
COMPUTE A, &Z=BREG, &Y=B, C
STOP
A DC ‘5’
B DC ‘3’
C DC ‘2’
END

You might also like