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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T09:36:43+00:00 2026-05-30T09:36:43+00:00

While investigating a crash, I came across the following code snippet and immediately recognized

  • 0

While investigating a crash, I came across the following code snippet and immediately recognized that the mov instruction should actually be movq to get the correct 64-bit register operation.

#elif defined(__x86_64__)
    unsigned long rbp;
    __asm__ volatile ("mov %%rbp, %0" : "=r" (rbp));
    sp = (void **) rbp;
#else

Further to this, I also found documentation that claims that the rbp register for x86-64 is general purpose and does not contain the address of the current frame. I have also found documentation that claims that rbp does contain the address of the current frame. Can someone clarify?

  • 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-30T09:36:44+00:00Added an answer on May 30, 2026 at 9:36 am

    Regarding the first part of your question (movq instead of mov), the assembler (as, in this case), will recognize that your operand is 64 bits, and will correctly use movq. mov is not a valid instruction, it’s a way to tell the assembler “use the right mov variant depending on the operands”.

    Regarding the second part, it’s actually both: it’s a general purpose register, in the sense that it can hold any value. It is also used as a stack-frame base pointer. The ‘2.4 Stack operation’ section of the AMD64 Application programming manual says:

    A stack is a portion of a stack segment in memory that is used to link
    procedures. Software conventions typically define stacks using a
    stack frame, which consists of two registers—a stack-frame base
    pointer (rBP) and a stack pointer (rSP)—

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

Sidebar

Related Questions

While investigating a reported problem with my site loading slowly, I came across an
While investigating an issue with application I'm working on, I've came across one behavior
I'm investigating a stack trace (seen while debugging) that looks something like the following:
While I was investigating a problem I had with lexical closures in Javascript code,
While investigating memory issues in our application, it turns out that if the application
Take the following code snippit: f = open(/mnt/remoteserver/bar/foo.bin, O_RDONNLY); while (true) { byteseread =
While investigating some localization options, I stumbled across this as a save option in
Often, while investigating some code I'm developing, I'll throw in a Console.WriteLine here or
I am experiencing a crash, and while investigating I found myself totally blocked by
I have been looking at monotorrent and while investigating the whole bittorrent thing I

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.