It is already implemented: throw an exception and catch is in some location on some upper-level stack frame. This is all you need.
Now, you can define your custom exception, but one suitable declaration already exists:
System.Threading.ThreadAbortException
:
http://msdn.microsoft.com/en-us/library/system.threading.threadabortexception.aspx[
^].
Not only you can use it for asynchronous thread abort (that is, from some other thread, by using
Thread.Abort
), but you can use it exactly for your purpose.
Problem solved.
[EDIT]
And of course, nothing like your inline assembly you (and me, too) gladly used with Delphi is applicable. CLR is very different: code is compiled into CIL (Common Intermediate Language), not CPU instructions. CPU comes into play when CIL is compiled with JIT. Please see:
http://en.wikipedia.org/wiki/Common_Intermediate_Language[
^],
http://en.wikipedia.org/wiki/Just-in-time_compilation[
^].
—SA