Whats wrong with my 'if statement' in assembly?

Started by
10 comments, last by Emmanuel Deloget 17 years, 11 months ago
It's not x86. It seems to be some type of simplified assembly language, designed for easy learning.
Advertisement
Edit: woop. My answer has nothing to do with your question. Funnay...

It looks like some MIPS dialect. In this case, remember that you have a 4 stage pipeline, and that any jump code will flush the two last stages. meaning that
set 00, r1ja L1set 00, r2  ; (1) this line is still in the pipeline and WILL BE EXECUTEDL1:

(1) is said to be in the "last delay slot". To avoid the execution of (1), put a nop right after the jump.

In your case, the beq (branch is equal) does the same. "set 00, r5" is in the LDS, and is executed.

Regards,

This topic is closed to new replies.

Advertisement