Jump to content
Tuts 4 You
Sign in to follow this  
0nion

Branching in Assembly

Recommended Posts

0nion
If ( a == b ) {

    ///////

}

This above code block in assembly as JE and 

The Following one, 

if ( a != b ) {

  ////////

}


 

JNE ? 

Share this post


Link to post
A200K

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 (see edit history)

Share this post


Link to post

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
Sign in to follow this  
×
×
  • Create New...