flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > Atempt for SEH macroses. |
Author |
|
JohnFound 16 Oct 2004, 08:17
Here is my first atempt to create simple macroses for handling exceptions.
The example use two levels of nested handlers and have some "interactiveness" to choose how to process exception. Check the attached file. You have to compile the example with Fresh, but it needs editing of some of the standard includes. Changed files are attached too. Please read readme.txt files (they are two ) for details. Of course you can use any version of FASM, after some play with Win32 include files. The only file you actually need except example sources is "exceptions.inc" Regards.
|
|||||||||||
16 Oct 2004, 08:17 |
|
JohnFound 16 Oct 2004, 11:23
decard wrote: you have coded try...catch statement (from C++) in assembly Well, I don't know how exactly is the syntax in C++, but in Delphi there are two types of exception handlers: "try...except" and "try...finally". Actually "finally" statement is looking strange for me, as far as code after "endTry" (or whatever close statement in another languages) can make the same work... maybe it is introduced because of some "structural considerations" . Regards. |
|||
16 Oct 2004, 11:23 |
|
decard 16 Oct 2004, 11:27
Quote: maybe it is introduced because of some "structural considerations" so we don't need it in assembly language |
|||
16 Oct 2004, 11:27 |
|
f0dder 16 Oct 2004, 16:52
Afaik "finally" is not part of the C++ language, but has been added as an extension by many vendors, including microsoft. Anyway: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccelng/htm/key_s-z_5.asp
|
|||
16 Oct 2004, 16:52 |
|
beppe85 26 Oct 2004, 11:32
I haven't looked at your code but you said 'Actually "finally" statement is looking strange for me, as far as code after "endTry" can make the same work'. Could I write the sample code:
Code: call AllocMem
try
...
finally
call FreeMem
end; It should free the object in any case, but rethrow an exception if something goes wrong. Forget this if you have this already. |
|||
26 Oct 2004, 11:32 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.