- Program with a conditional branch:
s1
s2
s3
cmp ...
bcc Label
nop
s4
s5
....
Label: t1
t2
....
|
- Same program, without a NOP instruction:
s1
s2
s3
cmp ...
bcc,a Label ! annulling version
t1
s4
s5
....
Label: t2
....
|
- Executed instructions when
branch taken:
s1
s2
s3
cmp ...
bcc,a Label
t1
t2
|
Same instructions and in same order executed as
in the original program:
s1
s2
s3
cmp ...
bcc Label
nop
t1
t2
|
- Executed instructions when
branch not taken:
s1
s2
s3
cmp ...
bcc,a Label
t1 fails, to branch ==> ANNULLED !!!
s4
s5
|
Again, it's the same instructions and order as
in the original program:
s1
s2
s3
cmp ...
bcc Label
nop
s4
s5
|
- Observation:
- In both cases, the
same serie of instructions are
executed in the
same order
- Both programs are equivalent
|
|