[comp.windows.ms.programmer] -G2 flag

wei@hpctdls.HP.COM (Bill Ives) (01/15/91)

     One thing the G2 switch does is generate 80286 entry and exit
     code for normal functions. I don't know if it makes any difference
     when Windows switches are used, but it does for normal C programming.
     Specifically, it will generate ENTER/LEAVE instructions around
     functions.... I think it also generates 286/386 shift and move
     derivatives ( not sure though ). These generally make shifting
     a register easier. i.e. on an 8086 you have to load CL to do a
     muliple shift in a single instruction (or have repeated single
     shift instructions ):
          mov  cl,4
          shl  ax,cl
     On a 286 it should become:  shl ax,4
     I think it will (or should) generate the PUSHA/POPA forms of
     register saving when the _saveregs directive is used in combination
     with the -G2 switch.

     Hope this helps a little

     Bill Ives
     HP CTD