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 6842293
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T00:04:55+00:00 2026-05-27T00:04:55+00:00

From time to time we have to analyze pieces of assembler code (IA32), and

  • 0

From time to time we have to analyze pieces of assembler code (IA32),
and more than often i come across an instruction that looks like this:

xor ax, ax

or with other registers aswell: xor dx, dx, xor al, al, …

What exactly does this do ? (ax xor ax always gives 0 ?)

  • 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. Editorial Team
    Editorial Team
    2026-05-27T00:04:56+00:00Added an answer on May 27, 2026 at 12:04 am

    It’s a common assembler idiom to set a register to 0.

    xor ax, ax corresponds to ax = ax ^ ax which, as you already noticed, is effectively ax = 0.

    If I recall correctly the main advantage is that its code-size is smaller than mov ax, 0

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

Sidebar

Related Questions

I have C# winforms application that needs to start an external exe from time
I have a WCF client that I'm having problems with. From time to time
A lot of time I have to code from home. Normally I just remote
I want to copy files that have timestamps from the time the script begins
I have a some code that gets passed a class derived from a certain
I have a code that loads data from Excel into SQLServer table. It works
I have an existing asp.net application that is currently in production for more than
I have a DevExpress VCL ribbon in my Delphi app From time to time
I have some trouble achieving adequate real-time performance from my application and wondering if
I am coming from C# background and I have hard time figuring out how

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.