Assignment 5.4 Ans

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

Assignment 5.

4 : Peephole Optimization

Apply Peephole Optimization techniques for the following and produce the optimized code.

1.

degug=0

if degug==1 goto L1

goto L2

L1: print debug information

L2:

2.

X*1 =?

X+1=?

x-1=?

2*x=?

Answers

1.

Goto L2

L2:

2. X*1 = X

X+1 = ++x

x-1 = --x

2*x = x+x

You might also like