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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T12:38:42+00:00 2026-06-06T12:38:42+00:00

I’m currently playing with C, C++ and ASM. I can see that there’s always

  • 0

I’m currently playing with C, C++ and ASM. I can see that there’s always difference of 12 between ebp substraction values. My disassembled code:

Code:

int main()
{
    int abc = 10;
    int def = 20;
    short int a = 1;
    long int b = 1000;

    //PlayFloat();

    GetValue();
    return 0;
}

Disassebled:

 push        ebp  
 mov         ebp,esp  
 sub         esp,0F0h  
 push        ebx  
 push        esi  
 push        edi  
 lea         edi,[ebp+FFFFFF10h]  
 mov         ecx,3Ch  
 mov         eax,0CCCCCCCCh  
 rep stos    dword ptr es:[edi]  
    ;int abc = 10;
 mov         dword ptr [ebp-8],0Ah  
    ;int def = 20;
 mov         dword ptr [ebp-14h],14h  
    ;short int a = 1;
 mov         eax,1  
 mov         word ptr [ebp-20h],ax  
    ;long int b = 1000;
 mov         dword ptr [ebp-2Ch],3E8h  

    ;//PlayFloat();

    ;GetValue();
 call        004110EB  
    ;return 0;
 xor         eax,eax

But why? Int takes 4 bytes and short only 2 bytes. So why there’s difference of 12? Please help.

EDIT:
It seems to be same in released listed asm code. I have set it in settings.

_TEXT   SEGMENT
_b$ = -44                       ; size = 4
_a$ = -32                       ; size = 2
_def$ = -20                     ; size = 4
_abc$ = -8                      ; size = 4
_main   PROC                        ; COMDAT

; 18   : {

    push    ebp
    mov ebp, esp
    sub esp, 240                ; 000000f0H
    push    ebx
    push    esi
    push    edi
    lea edi, DWORD PTR [ebp-240]
    mov ecx, 60                 ; 0000003cH
    mov eax, -858993460             ; ccccccccH
    rep stosd

; 19   :    int abc = 10;

    mov DWORD PTR _abc$[ebp], 10        ; 0000000aH

; 20   :    int def = 20;

    mov DWORD PTR _def$[ebp], 20        ; 00000014H

; 21   :    short int a = 1;

    mov eax, 1
    mov WORD PTR _a$[ebp], ax

; 22   :    long int b = 1000;

    mov DWORD PTR _b$[ebp], 1000        ; 000003e8H

; 23   : 
; 24   :    //PlayFloat();
; 25   : 
; 26   :    GetValue();

    call    _GetValue

; 27   :    return 0;

    xor eax, eax

; 28   : }

    pop edi
    pop esi
    pop ebx
    add esp, 240                ; 000000f0H
    cmp ebp, esp
    call    __RTC_CheckEsp
    mov esp, ebp
    pop ebp
    ret 0
_main   ENDP
_TEXT   ENDS

As you can see, there’s also difference of 12.

  • 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-06T12:38:44+00:00Added an answer on June 6, 2026 at 12:38 pm

    This is debug code. The space between variables is filled with 0CCCCCCCCh to detect e.g. buffer overruns.

    I’m sure you won’t see this in release builds. But you have to actually use the variables, so they are not optimized away in release build.

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

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I know there's a lot of other questions out there that deal with this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I want use html5's new tag to play a wav file (currently only supported
I have a French site that I want to parse, but am running into
I am doing a simple coin flipping experiment for class that involves flipping a

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.