MACRO EVAL&X, &Y, &Z AIF (&YEQ&Z). ONLY LOAD&X SUB & Y ADD & Z AGO .OVER .ONLY LOAD&Z .OVERMEND MACRO MAJOR &P,&Q,&R,&M,&N,&L EVAL &P&Q&R STORE &L EVAL &M,&N&N MEND START MAJOR A,B,C,D,E,F A DS 1 B DS 2 C DS 3 D DS 4 E DS 5 F DS 6 END
|
i) Compiler ii) Loader
iii) Assembler iv) Macroprocessor
Rel.Addr. PGA START 0 ENTRY PGAI 10 EXTRN PGB 20 DC A(PGA),(PGB+4) 30PGA1 DC A(PGA1-PGA) 34 END PGB START 0 ENTRY PGB1 5 EXTRN PGA 10 PGB1 DC A(PGB 1) 14 PGB2 DC A(PGB+4), A(PGB1-PGB) 18 PGB3 DC A(PGB-PGA-16) 22 END |
START 500 MOVER AREG, LAB ADD BREG, LOOP L1 DS 20 LOAD AREG,='5' ADD BREG,='1' BACK EQUL1 L2 SUB CREG, LAB LTORG MOVEM AREG, LAB ORIGIN L2 SUB BREG, ='2' LAB DC2 LOOP DS5 STOP END |
(a+b)*+(a+∈)*
!mage
S→S+S/SS/ (s)/ S*S/a
E→E+T / T
T→ T*F / F
F→id
Annotate the tree for 2+3*5
v1=(v2-v3)*(v2+2*v3)
If(condition) then p= q+r
Else x= y+z
for(i=1;<=10;i++)
X[i][2*j-1]=Y[i][2*j-1]
i) Removal of Loop Invariants
ii) Elimination of common sub expressions
iii) Dead code Elimination
iv) Copy Propagation