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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T09:14:51+00:00 2026-05-31T09:14:51+00:00

On Ubuntu Linux, 32 bit, x86 processor, compiling with GAS I’ve run into a

  • 0

On Ubuntu Linux, 32 bit, x86 processor, compiling with GAS

I’ve run into a very strange issue, wherein the contents of the %ebx register isn’t being returned as the status code of my program when I make the exit syscall. Here is the relevant code. Here is a dump of the registers just before the syscall:

eax            0x1  1
ecx            0x804a00c  134520844
edx            0xff  255
ebx            0x159  345
esp            0xbffff3bc  0xbffff3bc
ebp            0xbffff3c0  0xbffff3c0
esi            0x0  0
edi            0x0  0
eip            0x80480c6  0x80480c6 <num_loop_end+5>
eflags         0x246  [ PF ZF IF ]
cs             0x73  115
ss             0x7b  123
ds             0x7b  123
es             0x7b  123
fs             0x0  0
gs             0x0  0

And the relevant assembly code:

   0x080480c1 <+0>:  mov    $0x1,%eax
=> 0x080480c6 <+5>:  int    $0x80

The register dump occurred at the => above. However, instead of returning 345 as the status code, my program is exiting with code 89, or 0131 in octal. What might be causing this. Let me know if I should post more code, although I don’t know how that could affect this issue.

  • 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-31T09:14:52+00:00Added an answer on May 31, 2026 at 9:14 am

    This is perfectly normal behaviour, read the man page for exit:

    The exit() function causes normal process termination and the value of
    status & 0377 is returned to the parent (see wait(2)).

    0377 is an octal value, and it’s equivalent decimal value is 255. Therefore any value greater than 255 is going to end up less than that from the bitwise AND operation:

    345 AND 255 = 89
    

    That’s where the value 89 comes from.

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

Sidebar

Related Questions

I'm compiling Ruby 1.9.1-p376 under Ubuntu 8.04 server LTS (64-bit), by doing the following:
I'm running Ubuntu 64-bit version 11.04, with Eclipse Linux 64-bit edition. The Android SDK
I'm using ubuntu 64-bit and trying to run a .asm file on NASM. But
I have set up a 64 bit ubuntu env for compiling android tools (aapt,
I am looking to install java on Linux Ubuntu 64-bit. Should I use the
When I log into a particular Ubuntu Linux (10.04 64bit) host via SSH, I
On my Ubuntu linux box I can easily mount USB connected drives or CDROM
I have Ubuntu Linux. I found one command will let me download unread message
Iam working on Ubuntu.(Linux) I want to redirect from the page one.php to two.php,
I'm working on Ubuntu.(Linux) I want to display all .php pages to .html in

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.