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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T21:59:58+00:00 2026-06-04T21:59:58+00:00

I just started to learn a bit assembler from compiler output. test(1); This simple

  • 0

I just started to learn a bit assembler from compiler output.

test(1);

This simple function call creates following asm output (compiled with x64)

000000013FFF2E76  mov         ecx,1  
000000013FFF2E7B  call        test (13FFF33C0h) 

But why isn’t it:

000000013FFF2E76  push        1  
000000013FFF2E7B  call        test (13FFF33C0h) 

I thought a function parameter will be pushed to the stack and then poped in the function. Can somebody explain why VS prefer the top one?

  • 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-06-04T22:00:02+00:00Added an answer on June 4, 2026 at 10:00 pm

    It’s because that’s the ABI on x64 Windows.

    On Windows x64, the first integer argument is passed in RCX, the second in RDX, the third in R8 and the fourth in R9. The fifth and following are passed through the stack.

    Because your function has a single argument, only RCX is used.

    The compiler issued a write to ECX because all writes to 32-bit registers result in zeroing the higher part of the 64-bit register, and 32-bit immediates are obviously shorter than 64-bit ones (instruction cache anyone?).

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

Sidebar

Related Questions

I just started to learn Rails from railstutorial.org. After installing Rails I cerated an
I just started learning C++(coming from Java & Python) and am trying to learn
I just started to learn C programming. In my book there is this piece
I've just started to learn Haskell and I am trying to write a simple
I just started to learn jQuery and I came across this site- TEDx Portland
I just started to learn Django and Python. I use the online book from
I just started to learn a little bit about canvas! I want to draw
I've just started trying to learn JS so apologies if this seems like a
I just started to learn Android and I wrote the following code followed a
I have just started to learn C# and I'm a little bit confused about

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.