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

  • Home
  • SEARCH
  • 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 682425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T01:35:39+00:00 2026-05-14T01:35:39+00:00

The following C#-snippet: var x = 1; var y = 1; if (x ==

  • 0

The following C#-snippet:

var x = 1;
var y = 1;
if (x == y)
    Console.Write("True");

Generates this MSIL:

.locals init (
            [0] int32 x,
            [1] int32 y,
            [2] bool CS$4$0000)
L_0000: nop 
L_0001: ldc.i4.1 
L_0002: stloc.0 
L_0003: ldc.i4.1 
L_0004: stloc.1 
L_0005: ldloc.0 
L_0006: ldloc.1 
L_0007: ceq 
L_0009: ldc.i4.0 
L_000a: ceq 
L_000c: stloc.2 
L_000d: ldloc.2 
L_000e: brtrue.s L_001b
L_0010: ldstr "True"
L_0015: call void [mscorlib]System.Console::Write(string)
L_001a: nop 
L_001b: ret 

Why is there two ceq calls?

Thanks

  • 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-14T01:35:40+00:00Added an answer on May 14, 2026 at 1:35 am

    The second ceq opcode compares the result of the first one to 0. (false)

    This result is then put in a variable, loaded from the variable, and, if it was true, the WriteLine call is skipped.

    I would assume that Release mode generates more efficient code, but I’m too lazy to check.

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

Sidebar

Related Questions

I have the following snippet of JS var Customer : function() { this.ShipProduct :
Consider the following snippet: var regex = /^\d+$/; // equivalent to new RegExp('^\\d+$'); console.println(regex.test('000'));
Geeks, I have the following codes: Snippet A: var x = (function(){ this.id=Dog; return
I have following code snippet: var reg = /^[0-9]$/; $('input[type=text]').keypress(function(){ console.log(reg.test(parseInt($(this).val()))); }); When I
I have the following snippet of code: $('input#teamName').live('blur', function() { var value = $(this).val();
Consider the following snippet of code: foreach (var setting in RequiredSettings) { try {
Following snippet attempts to write the name of directories and files present in some
I have the following code (snippet): var numRows = $table.find('tbody tr').length; var numPages =
Given the following snippet of javascript in a scope: var x = 10; function
Let us consider the following JavaScript snippet var arr = []; function pushMe() {

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.