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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T18:37:11+00:00 2026-05-28T18:37:11+00:00

I am using gdb to examine a program. In assembly, the code is doing:

  • 0

I am using gdb to examine a program. In assembly, the code is doing:

cmp $0x5, %eax

However, when I examine the contents of %eax, I get: \020\343\377\377\377\177 when examined as a string.

How is \020\343\377\377\377\177 compared to $0x5 in assembly?

  • 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-28T18:37:12+00:00Added an answer on May 28, 2026 at 6:37 pm

    cmp, in this case, is comparing the value in eax to a constant 5. The value pointed to by eax, if you think it is in fact a pointer, isn’t compared to the constant at all.

    The comparison is done by subtraction – in your case, that means 5 is subtracted from the value in eax, and several flags (CF, OF, SF, ZF, AF, and PF, according to the documentation) are set appropriately. Normally the cmp instruction is followed by a conditional instruction of some kind (often a jump), to perform different actions depending on the results of the comparison.

    If you tell us the value in eax, rather than interpreting eax as a pointer, I might be able to give you some more information. You can use p $eax or info registers to get the value of eax in gdb.

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

Sidebar

Related Questions

I am using gdb to debug a C++ program. I have this code: int
I get a segmentation fault when I cancel my program. I am using gdb
So I am debugging an x86 program using GDB. I am in a certain
I am using GDB to understand a C++ program. I put a break in
Using gdb, I can type 'info threads' or 'thread apply all backtrace' to get
I am using gdb to debug a program, and I want to have the
I'm using gdb to debug some c++ code. At the moment the code I'm
I want to examine the contents of a std::vector in gdb but I don't
Using GDB, I find I get a segmentation fault when I attempt this operation:
I'm using gdb to debug a c++ program which terminated with a segmentation fault.

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.