svn commit: r1762 - in trunk/yasm: Mkfiles Mkfiles/vc/modules Mkfiles/vc8/modules modules/objfmts/coff modules/objfmts/win64/tests po

peter at tortall.net peter at tortall.net
Sun Feb 11 19:48:53 PST 2007


Author: peter
Date: Sun Feb 11 19:48:53 2007
New Revision: 1762

Added:
   trunk/yasm/modules/objfmts/coff/coff-objfmt.h   (contents, props changed)
   trunk/yasm/modules/objfmts/coff/win64-except.c   (contents, props changed)
   trunk/yasm/modules/objfmts/win64/tests/sce1-err.asm
   trunk/yasm/modules/objfmts/win64/tests/sce1-err.errwarn
   trunk/yasm/modules/objfmts/win64/tests/sce1.asm
   trunk/yasm/modules/objfmts/win64/tests/sce1.hex
   trunk/yasm/modules/objfmts/win64/tests/sce2-err.asm
   trunk/yasm/modules/objfmts/win64/tests/sce2-err.errwarn
   trunk/yasm/modules/objfmts/win64/tests/sce2.asm
   trunk/yasm/modules/objfmts/win64/tests/sce2.hex
   trunk/yasm/modules/objfmts/win64/tests/sce3.asm
   trunk/yasm/modules/objfmts/win64/tests/sce3.hex
   trunk/yasm/modules/objfmts/win64/tests/sce3.masm
   trunk/yasm/modules/objfmts/win64/tests/sce4-err.asm
   trunk/yasm/modules/objfmts/win64/tests/sce4-err.errwarn
   trunk/yasm/modules/objfmts/win64/tests/sce4.asm
   trunk/yasm/modules/objfmts/win64/tests/sce4.hex
   trunk/yasm/modules/objfmts/win64/tests/sce4.masm
Modified:
   trunk/yasm/Mkfiles/Makefile.dj
   trunk/yasm/Mkfiles/Makefile.flat
   trunk/yasm/Mkfiles/vc/modules/modules.vcproj
   trunk/yasm/Mkfiles/vc8/modules/modules.vcproj
   trunk/yasm/modules/objfmts/coff/Makefile.inc
   trunk/yasm/modules/objfmts/coff/coff-objfmt.c
   trunk/yasm/modules/objfmts/win64/tests/Makefile.inc
   trunk/yasm/modules/preprocs/nasm/standard.mac
   trunk/yasm/po/POTFILES.in
Changeset:
   http://www.tortall.net/projects/yasm/changeset/1762

Log:
Add support for Win64 structured exception handling (aka .xdata and .pdata).

Requested by: Myria Chan, Brian Gladman, several others
Helped by: Brian Gladman (format documentation pointers)

This commit adds the necessary directives and some higher-level macros to
make it easier to generate the .xdata and .pdata sections needed for
structured exception handling on Win64.  The overall construction mirrors
MASM very closely, so it should be possible for near-direct translation of
MASM code to Yasm; see for example objfmts/win64/tests/sce3.masm and
objfmts/win64/tests/sce4.asm.  This commit does *not* break generating these
yourself (which you may want to do if you're a compiler).

This commit adds special proc macros so the function layout will look like:

proc_frame <procname>
... (frame setup and unwind directives)
end_prologue (or alternatively [endprolog])
...
endproc_frame

The "raw pseudo operations" (.directives) as described in MSDN
(http://msdn2.microsoft.com/en-us/library/ms235231(VS.80).aspx)
have been exactly mirrored in Yasm, as follows:
[pushreg], [setframe], [allocstack], [savereg], [savexmm128], [pushframe],
[endprolog]

Note the [] are required.

Additionally, the following macros have been implemented that MASM provides
in ksamd64.inc, and as documented in MSDN
(http://msdn2.microsoft.com/en-us/library/ms235217(VS.80).aspx):
push_reg, rex_push_reg, push_eflags, rex_push_eflags, alloc_stack,
save_reg, save_xmm128, push_frame, set_frame, end_prologue

I'll next work on getting all of this documented in the user manual.



More information about the yasm-cvs mailing list