delorie.com/archives/browse.cgi | search |
From: | zacharyshort AT hotmail DOT com (ZMAN) |
Newsgroups: | comp.os.msdos.djgpp |
Subject: | Re: DJGPP reserves wrong int size |
Date: | 24 Jun 2001 17:42:36 -0700 |
Organization: | http://groups.google.com/ |
Lines: | 23 |
Message-ID: | <9dde68b7.0106241642.25039874@posting.google.com> |
References: | <9dde68b7 DOT 0106241053 DOT 2a385311 AT posting DOT google DOT com> <200106242138 DOT RAA18013 AT envy DOT delorie DOT com> |
NNTP-Posting-Host: | 216.227.179.144 |
X-Trace: | posting.google.com 993429756 2208 127.0.0.1 (25 Jun 2001 00:42:36 GMT) |
X-Complaints-To: | groups-support AT google DOT com |
NNTP-Posting-Date: | 25 Jun 2001 00:42:36 GMT |
To: | djgpp AT delorie DOT com |
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
Reply-To: | djgpp AT delorie DOT com |
DJ Delorie <dj AT delorie DOT com> wrote in message news:<200106242138 DOT RAA18013 AT envy DOT delorie DOT com>... > > 00000000 55 push ebp > > 00000001 89E5 mov ebp,esp > > 00000003 83EC04 sub esp,byte +0x18 > > 00000006 C745FC78563412 mov dword [ebp-0x4],0x12345678 > > 0000000D C9 leave > > 0000000E C3 ret > > > > The third line reserves 18 bytes. > > And it should reserve 4 bytes because thats the size of an int right? > > If you declare a char it still reserves 18 bytes. > > Could someone tell me what's going on? I am loosing my mind! > > Line 4 is correct though. > > The purpose of that is to keep the stack aligned to a 32 byte > boundary, which improves performance on today's high-end processors. > > 4 (the call) + 4 (the push) + 24 (the sub) = 32 > > You can change that with command line options (-mpreferred-stack-boundary=) Thanks you for clearing that up. I feel like an idiot.
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |