Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 154315
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T09:57:26+00:00 2026-05-11T09:57:26+00:00

So, SUPER low-level what does an IF() look like, how is it handled by

  • 0

So, SUPER low-level what does an IF() look like, how is it handled by an x86 processor?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T09:57:27+00:00Added an answer on May 11, 2026 at 9:57 am

    The processor has ‘Branch if’ instructions that when a certain condition is met it branches, and otherwise it continues on to the next instruction.

    So

    if(A) {     dosomething; } 

    would become

    load A into register 0 if the zero flag is set (ie, register 0 contains 0x00) then jump to endcondition) dosomething endcondition: 

    More complex conditions ( if(A || B && C) ) become a sequence of instructions that leaves a register in a 0 or non zero state, so the branchif instruction can jump or not jump based on the conditional flags.

    There are many conditional flags (zero, carry, negative, overflow, etc), and some branchif instructions also operate on more complex conditions (ie, it might actually check to see if a register is equal to another register, rather than simply looking at flags). Each architecture is different and makes tradeoffs so the instruction set is complete, but also speedy and compact.

    As moocha points out in the comments, some architectures allow you to apply a conditional to some, many, or even all instructions, so you might not only have ‘branch if’ instructions, but also ‘and if’, ‘add if’, ‘move if’ etc.

    The x86 is very, very, very complex beyond this simple explanation once you get into pipelining, out of order execution, caching, microcode, and all the other advanced topics. For most purposes the above explanation is sufficient. If you’re writing a hand crafted very, very tightly wound algorithm, though, you’ll have to take these things into account for maximum performance and throughput.

    That’s a topic for another question though…

    -Adam

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

WatchService sounded like an exciting idea ... unfortunately it seems to be as low-level
Super quick one. Here is my .gitignore (at the root level of my repo
Is C# a super set of C (like Objective-C and C++)? I mean, can
OK, this should be super low hanging fruit. I'm aware of .last() and yet
I have a low level caching mechanism which receives a json array from a
Super-newbie question! I've been looking for a list of all the classes that come
Super weird problem here. I'm having trouble getting jQuery to bind any selectors except
the super keyword tells the compiler to search for method in the superclass of
-(id) init { // always call super init // Apple recommends to re-assign self
What happens when [super loadView] or [super viewDidLoad] is written? I tried to remove

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.