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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T13:54:59+00:00 2026-05-15T13:54:59+00:00

Dump of assembler code for function main: 0x0804833e <+0>: push %ebp 0x0804833f <+1>: mov

  • 0
Dump of assembler code for function main:
   0x0804833e <+0>:     push   %ebp
   0x0804833f <+1>:     mov    %esp,%ebp
   0x08048341 <+3>:     sub    $0x8,%esp
   0x08048344 <+6>:     and    $0xfffffff0,%esp
   0x08048347 <+9>:     mov    $0x0,%eax
   0x0804834c <+14>:    add    $0xf,%eax
   0x0804834f <+17>:    add    $0xf,%eax
   0x08048352 <+20>:    shr    $0x4,%eax
   0x08048355 <+23>:    shl    $0x4,%eax
   0x08048358 <+26>:    sub    %eax,%esp
=> 0x0804835a <+28>:    movl   $0x10,-0x4(%ebp)
   0x08048361 <+35>:    movl   $0x0,-0x8(%ebp)
   0x08048368 <+42>:    pushl  -0x4(%ebp)
   0x0804836b <+45>:    call   0x8048334 <myfunc1 at test.c:4>
   0x08048370 <+50>:    add    $0x4,%esp
   0x08048373 <+53>:    pushl  -0x8(%ebp)
   0x08048376 <+56>:    call   0x8048339 <myfunc2 at test.c:8>
   0x0804837b <+61>:    add    $0x4,%esp
   0x0804837e <+64>:    mov    $0x0,%eax
   0x08048383 <+69>:    leave
   0x08048384 <+70>:    ret
End of assembler dump.
(gdb) info line
Line 16 of "test.c" starts at address 0x804835a <main+28 at test.c:16> and ends at 0x8048361 <main+35 at test.c:17>.------------------------------------(1)
(gdb) shell cat test.c
#include<stdio.h>

void myfunc1(int recv_arg1)
{
        /* does nothing */
}
void myfunc2(int recv_arg1)
{
   /* does nothing */
}

int main(int argc,char **argv)
{
        int var1;
        int var2;
        var1 = 16;
        var2 = 0;
        myfunc1(var1);
        myfunc2(var2);
        return 0;
}

Note in (1) that the asm code for main is within that range !! and the asm code before this range is for something else ? What ? surely something mysterious !!

  • 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-15T13:55:00+00:00Added an answer on May 15, 2026 at 1:55 pm

    Allow me to comment this for you.

       0x0804833e <+0>:     push   %ebp                    ; Establish standard
       0x0804833f <+1>:     mov    %esp,%ebp               ; stack frame record
       0x08048341 <+3>:     sub    $0x8,%esp               ; Make room for locals
       0x08048344 <+6>:     and    $0xfffffff0,%esp        ; Align esp to 16-byte memory
       0x08048347 <+9>:     mov    $0x0,%eax               ; eax=0
       0x0804834c <+14>:    add    $0xf,%eax               ; eax=f
       0x0804834f <+17>:    add    $0xf,%eax               ; eax=  (eax + 0xf)
       0x08048352 <+20>:    shr    $0x4,%eax               ;      (             >> 4)
       0x08048355 <+23>:    shl    $0x4,%eax               ;     (                    << 4)
       ;The above math rounds up eax as set by 0x0804834c to the next 16-byte boundary
       ;In this case, eax will be 0x10, rounded up from 0x0f.  You compiled without
       ;optimizations?  This could be a "probe" checking whether the upcoming call 
       ;will fail?
    
       0x08048358 <+26>:    sub    %eax,%esp               ; Make room for "0x10 more mystery bytes"
       0x0804835a <+28>:    movl   $0x10,-0x4(%ebp)        ; var1 = 16
       0x08048361 <+35>:    movl   $0x0,-0x8(%ebp)         ; var2 = 0
       0x08048368 <+42>:    pushl  -0x4(%ebp)              ; push           var1
       0x0804836b <+45>:    call   0x8048334 <myfunc1 at test.c:4> ;myfunc1(    );
      0x08048370 <+50>:    add    $0x4,%esp                ; pop (var1)
       0x08048373 <+53>:    pushl  -0x8(%ebp)              ; push           var2
       0x08048376 <+56>:    call   0x8048339 <myfunc2 at test.c:8> ;myfunc2(    );
       0x0804837b <+61>:    add    $0x4,%esp               ; pop (var2)
       0x0804837e <+64>:    mov    $0x0,%eax               ; return 0;
       0x08048383 <+69>:    leave                          ; undo standard stack frame
       0x08048384 <+70>:    ret                            ; actual return
    

    I think it is a good question, why finally execute 0x08048358 which allocates seemingly useless space. I suspect this is a check for esp out of range exception before performing the call. If you specify the processor you are using, I wonder if this will “go away” — it smells like it might be for a specific chip’s errata.

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

Sidebar

Related Questions

(gdb) disas foo Dump of assembler code for function foo: 0x00000000004004a8 <foo+0>: push %rbp
(gdb) disas htons Dump of assembler code for function ntohs: 0x00000037aa4e9470 <ntohs+0>: ror $0x8,%di
(gdb) disas /m main Dump of assembler code for function main(): 2 { 0x080483f4
Dump of assembler code for function foo@plt: 0x0000000000400528 <foo@plt+0>: jmpq *0x2004d2(%rip) # 0x600a00 <_GLOBAL_OFFSET_TABLE_+40>
So I have the following code segment in x86 assembly: mov $0x0, %eax callq
Below is my code (test.c): #include <stdio.h> #include <string.h> int main(int argc, char **argv)
Cannot dump Stack Overflow XML file into SQL Server 2008. Could you please explain
How can I dump all the global variables and the address offsets in my
I try to dump my data thought php script but without command line. SO
When I dump my the varable var_dump($search_results_returned['post_q_2_full']); the following is printed: array(1) { [0]=>

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.