[comp.windows.ms] Microsoft C 5.1 compiler and -Gw

goudal@geocub.greco-prog.fr (Frederic Goudal) (07/04/90)

I am developping some code for windows 2.1 (waiting for the 3.0 SDK in France)
using the 5.1 Microsoft C (waiting for the 6.0 in France !!!)
I need to worry about the producted code, so I compile with the following
options : -c -AL -Gw -u -W2 -Zpe -Gs -Fa
When I compile a function witch looks like
void toto(a,b)
int a,b;
{
long c;
...
}
I obtain the following code for the begining and the end of the function:
begining :
1 push ds
2 pop ax        why not mov ax,ds ??? 
3 nop           why ???????
4 inc bp        why ??????
5 push bp
6 mov bp,sp
7 push ds
8 mov ds,ax	instructions a and b must have put the value of ds in ax
9 sub sp,6       I need only 4 bytes why 6???

For the end of the function there are the instructions:
sub bp,2
mov sp,bp
why not sub sp,(the good value 4) ??

Thanks in advance for the answers by e-mail at :
goudal@geocub.greco-prog.fr






-- 

goudal@geocub.greco_prog.fr          "Why can't we reach the sun?"
oral-mail : babbs			 Pink Floyd