<div dir="auto"><div class="gmail_quote" dir="auto"><div dir="ltr">Matias Vara <<a href="mailto:matiasevara@gmail.com">matiasevara@gmail.com</a>> schrieb am Mi., 25. Juli 2018, 12:55:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_quote"><div dir="ltr">El mar., 24 jul. 2018 a las 13:57, Sven Barth via fpc-pascal (<<a href="mailto:fpc-pascal@lists.freepascal.org" target="_blank" rel="noreferrer">fpc-pascal@lists.freepascal.org</a>>) escribió:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div class="gmail_quote" dir="auto"><div dir="ltr">Matias Vara <<a href="mailto:matiasevara@gmail.com" target="_blank" rel="noreferrer">matiasevara@gmail.com</a>> schrieb am Di., 24. Juli 2018, 11:04:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hello,</div><div><br></div><div>I am writing my own __FPC_specific_handler() but I can't figure out when this function is registered. I guess this function is registered to the OS to be invoked when an exception happens. In the assembler code I have something like:</div><div> </div><div>.seh_handler __FPC_specific_handler,@unwind<br></div><div><br></div><div>But I am puzzled by "@unwind". How is <span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">__FPC_specific_handler() invoked<br></span></div></div></blockquote></div><div dir="auto"><br></div><div dir="auto">To understand the .seh_*-pseudo instructions it's probably best to look at their initial check-in in the GNU assembler: <a href="https://sourceware.org/ml/binutils/2009-08/msg00193.html" target="_blank" rel="noreferrer">https://sourceware.org/ml/binutils/2009-08/msg00193.html</a></div><div dir="auto"><br></div><div dir="auto">The handler function is invoked by Windows when an exception happens inside the code that is governed by the surrounding (implicit) .seh_(end)proc directives. </div><div dir="auto"><br></div><div dir="auto">Why are you writing your own handler? </div><div dir="auto"><br></div></div></blockquote><div><br></div><div>Thanks for the answer, I am trying to make work the exceptions handling in Toro kernel. Currently Toro is based on Win64 rtl. I think I will give up with the Win64 RTL and move to a simpler RTL.</div></div></div></blockquote></div><div dir="auto"><br></div><div dir="auto">I think I suggested some time ago already that you should use the embedded targets for writing a kernel. That's what they're there for after all. </div><div dir="auto"><br></div><div dir="auto">Regards, </div><div dir="auto">Sven </div><div class="gmail_quote" dir="auto"></div></div>