| delorie.com/archives/browse.cgi | search |
| Message-ID: | <3B365AD8.BA907BD1@earthlink.net> |
| From: | Martin Ambuhl <mambuhl AT earthlink DOT net> |
| X-Mailer: | Mozilla 4.76 [en] (Win95; U) |
| X-Accept-Language: | en,zh-CN,fr,de-CH,ru |
| MIME-Version: | 1.0 |
| Newsgroups: | comp.os.msdos.djgpp,comp.lang.c++,comp.lang.c |
| Followup-To: | comp.os.msdos.djgpp |
| Subject: | Re: DJGPP reserves wrong int size |
| References: | <9dde68b7 DOT 0106241053 DOT 2a385311 AT posting DOT google DOT com> |
| Lines: | 45 |
| Date: | Sun, 24 Jun 2001 21:24:12 GMT |
| NNTP-Posting-Host: | 209.246.74.222 |
| X-Complaints-To: | abuse AT earthlink DOT net |
| X-Trace: | newsread1.prod.itd.earthlink.net 993417852 209.246.74.222 (Sun, 24 Jun 2001 14:24:12 PDT) |
| NNTP-Posting-Date: | Sun, 24 Jun 2001 14:24:12 PDT |
| Organization: | EarthLink Inc. -- http://www.EarthLink.net |
| X-Received-Date: | Sun, 24 Jun 2001 14:22:02 PDT (newsmaster1.prod.itd.earthlink.net) |
| To: | djgpp AT delorie DOT com |
| DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
| Reply-To: | djgpp AT delorie DOT com |
ZMAN wrote:
>
> Please consider the following code:
>
> int main ()
> {
> int i;
> i = 0x12345678;
> }
>
> -Yes I am aware there is no return statement even if I do have it in there
> it still messes up.
> When I compile this code using:
>
> gcc -c test.c
> ld -o test -Ttext 0x0 -e main test.o
> objcopy -R .note -R .comment -S -O binary test test.bin
>
> and disassemble it I get the following:
>
> 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
Notice the in the following a completely different result from gcc.
Your implementation-specific question is not topical for any of comp.lang.c or
comp.lang.c++. I have removed them from the follow-ups.
Your implementation-specific question is also invocation-specific.
.file "a.c"
gcc2_compiled.:
___gnu_compiled_c:
.text
.p2align 2
.globl _main
_main:
pushl %ebp
movl %esp,%ebp
movl %ebp,%esp
popl %ebp
ret
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |