(1) i := m − 1
(2) j := n
(3) t1 := 4* n
(4) v := a[t1]
(5) i := i + 1
(6) t2 := 4 * i
(7) t3 := a[t2]
(8) if t3 < v goto (5)
(9) j := j − 1
(10) t4 := 4 * j
(11) t5 := a[t4]
(12) if t5 > v goto (9)
(13) if i >= j goto (23)
(14) t6 := 4 * i
(15) x := a[t6] |
(16) t7 := 4 * i
(17) t8 := 4 * j
(18) t9 := a[t8]
(19) a[t7] := t9
(20) t10 := 4 * j
(21) a[t10] := x
(22) goto (5)
(23) t11 := 4 * i
(24) x := a[t11]
(25) t12 := 4 * i
(26) t13 := 4 * n
(27) t14 := a[t13]
(28) a[t12] := t14
(29) t15 := 4 * n
(30) a[t15] := x |
Flow Graph
Add flow of control information to basic blocks. The directed graph is called flow graph. The nodes of the flow graph are basic blocks.
One node is initial. There is a directed edge from block B1 to block B2 if B2
follows B1 in execution order.
- Jump from B1 to B2
- B2 follows B1 in the order of the program
|