Jump to content
Tuts 4 You

Branching in Assembly


0nion

Recommended Posts

If ( a == b ) {

    ///////

}

This above code block in assembly as JE and 

The Following one, 

if ( a != b ) {

  ////////

}


 

JNE ? 

Link to comment

Well, yes, so what is your question?

 

Edit:

In asm it will negate the term and jump over the code which should be executed when the if condition is true, so its like

If ( a == b )

{

DoStuff ();

}

// Other Stuff

 

In asm:

 

cmp eax, ebx ; eax = a, ebx = b

JNE after_cond

call DoStuff

after_cond:

; // Other Stuff

 

And vice versa

Edited by A200K
Added example
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...