<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'>understood, did the attachment not come through?<BR>
attached again<BR>
(parse.c changes aren't really relevant here anyway, not for the *c files, but for the *s files)<BR>
 <BR>
 - Jay<BR><BR><BR>

<HR id=stopSpelling>
<BR>
> CC: m3devel@elegosoft.com<BR>> From: hosking@cs.purdue.edu<BR>> Subject: Re: stdcall naming discrepancy?<BR>> Date: Mon, 4 Feb 2008 16:19:38 -0500<BR>> To: jayk123@hotmail.com<BR>> <BR>> Jay,<BR>> <BR>> I'm not on Windows so I can't diagnose the stdcall problem. I want <BR>> to see the .mc file so I can get a sense of what is going on.<BR>> <BR>> On Feb 4, 2008, at 4:01 PM, Jay wrote:<BR>> <BR>> > This is without your most recent changes.<BR>> ><BR>> ><BR>> ><BR>> ><BR>> > > CC: m3devel@elegosoft.com<BR>> > > From: hosking@cs.purdue.edu<BR>> > > Subject: Re: stdcall naming discrepancy?<BR>> > > Date: Mon, 4 Feb 2008 15:30:23 -0500<BR>> > > To: jayk123@hotmail.com<BR>> > ><BR>> > > OK. Not sure I understand what is going on then -- I would like to<BR>> > > see the .mc file to get a sense of things.<BR>> > ><BR>> > > On Feb 4, 2008, at 2:43 PM, Jay wrote:<BR>> > ><BR>> > > > I think they are being passed correctly, by value. pop_struct and<BR>> > > > not pop_param is used.<BR>> > > > When I get time, I will put my parse.c back (uncommited) and then<BR>> > > > just try some tests with "__cdecl" passing and returning structs.<BR>> > > > That removes the naming issue and PART of the calling convention<BR>> > > > issue and tests what is left.<BR>> > > > Then I'll see if I can hack something up to test the rest.<BR>> > > ><BR>> > > > - Jay<BR>> > > ><BR>> > > ><BR>> > > ><BR>> > > > > CC: m3devel@elegosoft.com<BR>> > > > > From: hosking@cs.purdue.edu<BR>> > > > > Subject: Re: stdcall naming discrepancy?<BR>> > > > > Date: Mon, 4 Feb 2008 09:52:31 -0500<BR>> > > > > To: jayk123@hotmail.com<BR>> > > > ><BR>> > > > > Any chance that standard_structs in Target.i3 is causing the <BR>> > front-<BR>> > > > > end to pass structs by reference (standard structs=TRUE)? Also,<BR>> > > > > looking at pop_struct in parse.c it seems to want to pass <BR>> > them by<BR>> > > > > reference (standard_structs=FALSE)? In any case, what does the<BR>> > > > > integrated back-end do with pop_struct? I bet it is passing by<BR>> > > > > value... whereas parse.c passes by ref. Blurgh! Looks like we <BR>> > need<BR>> > > > > to smarten things up for calls to non-M3 stdcall procedures.<BR>> > > > ><BR>> > > > > On Feb 4, 2008, at 1:23 AM, Jay wrote:<BR>> > > > ><BR>> > > > > > (and codegen..)<BR>> > > > > ><BR>> > > > > > C:\dev2\j\m3\t>type t.c<BR>> > > > > ><BR>> > > > > > typedef struct {<BR>> > > > > > int a,b,c,d,e,f;<BR>> > > > > > } Foo_t;<BR>> > > > > ><BR>> > > > > > void __stdcall Sleep(Foo_t foo);<BR>> > > > > ><BR>> > > > > > extern Foo_t a;<BR>> > > > > ><BR>> > > > > > void F1()<BR>> > > > > > {<BR>> > > > > > Sleep(a);<BR>> > > > > > }<BR>> > > > > ><BR>> > > > > > C:\dev2\j\m3\t>gcc -c -S t.c<BR>> > > > > ><BR>> > > > > > C:\dev2\j\m3\t>type t.s<BR>> > > > > > .file "t.c"<BR>> > > > > > .text<BR>> > > > > > .globl _F1<BR>> > > > > > .def _F1; .scl 2; .type 32; .endef<BR>> > > > > > _F1:<BR>> > > > > > pushl %ebp<BR>> > > > > > movl %esp, %ebp<BR>> > > > > > subl $24, %esp<BR>> > > > > > movl _a, %eax<BR>> > > > > > movl %eax, (%esp)<BR>> > > > > > movl _a+4, %eax<BR>> > > > > > movl %eax, 4(%esp)<BR>> > > > > > movl _a+8, %eax<BR>> > > > > > movl %eax, 8(%esp)<BR>> > > > > > movl _a+12, %eax<BR>> > > > > > movl %eax, 12(%esp)<BR>> > > > > > movl _a+16, %eax<BR>> > > > > > movl %eax, 16(%esp)<BR>> > > > > > movl _a+20, %eax<BR>> > > > > > movl %eax, 20(%esp)<BR>> > > > > > call _Sleep@24<BR>> > > > > > subl $24, %esp<BR>> > > > > > leave<BR>> > > > > > ret<BR>> > > > > > C:\dev2\j\m3\t><BR>> > > > > ><BR>> > > > > > (NOTE: This is NOT the correct declaration of Sleep, but ok <BR>> > for<BR>> > > > > > testing purposes.)<BR>> > > > > ><BR>> > > > > > C:\dev2\j\m3\t>type t.i3<BR>> > > > > > INTERFACE T;<BR>> > > > > ><BR>> > > > > > TYPE Foo_t = RECORD<BR>> > > > > > a,b,c,d,e,f : INTEGER;<BR>> > > > > > END;<BR>> > > > > ><BR>> > > > > > <*EXTERNAL Sleep:WINAPI*><BR>> > > > > > PROCEDURE Sleep (dwMilliseconds1: Foo_t);<BR>> > > > > > END T.<BR>> > > > > ><BR>> > > > > > C:\dev2\j\m3\t>type t.m3<BR>> > > > > ><BR>> > > > > > MODULE T;<BR>> > > > > > VAR<BR>> > > > > > Foo: Foo_t;<BR>> > > > > ><BR>> > > > > > BEGIN<BR>> > > > > > Sleep(Foo);<BR>> > > > > > END T.<BR>> > > > > ><BR>> > > > > ><BR>> > > > > > LM1:<BR>> > > > > > movl 8(%ebp), %eax<BR>> > > > > > xorl $1, %eax<BR>> > > > > > testb %al, %al<BR>> > > > > > jne L2<BR>> > > > > > .stabn 68,0,6,LM2-_T_M3<BR>> > > > > > LM2:<BR>> > > > > > movl $_MM_T+52, %eax<BR>> > > > > > movl %eax, %edx<BR>> > > > > > subl $8, %esp<BR>> > > > > > subl $24, %esp<BR>> > > > > > movl %esp, %eax<BR>> > > > > > movl %eax, %edi<BR>> > > > > > movl %edx, %esi<BR>> > > > > > cld<BR>> > > > > > movl $6, %eax<BR>> > > > > > movl %eax, %ecx<BR>> > > > > > rep<BR>> > > > > > movsl<BR>> > > > > > call _Sleep@4<BR>> > > > > > addl $8, %esp<BR>> > > > > > L2:<BR>> > > > > > movl $_MM_T, %eax<BR>> > > > > > LBE2:<BR>> > > > > > leal -8(%ebp), %esp<BR>> > > > > > popl %esi<BR>> > > > > > popl %edi<BR>> > > > > > leave<BR>> > > > > > ret<BR>> > > > > ><BR>> > > > > > ?<BR>> > > > > ><BR>> > > > > > - Jay<BR>> > > > > ><BR>> > > > > > Connect and share in new ways with Windows Live. Get it now!<BR>> > > > ><BR>> > > ><BR>> > > ><BR>> > > > Climb to the top of the charts! Play the word scramble challenge<BR>> > > > with star power. Play now!<BR>> > ><BR>> ><BR>> ><BR>> > Connect and share in new ways with Windows Live. Get it now! <BR>> > <t.tar.bz2><BR>> <BR><BR><br /><hr />Helping your favorite cause is as easy as instant messaging. You IM, we give. <a href='http://im.live.com/Messenger/IM/Home/?source=text_hotmail_join' target='_new'>Learn more.</a></body>
</html>