Fix for nasm 0.98
[reactos.git] / reactos / lib / pseh / i386 / setjmp.asm
index abc81b1..d2ac8ea 100644 (file)
@@ -1,4 +1,4 @@
-; Copyright (c) 2004 KJK::Hyperion
+; Copyright (c) 2004/2005 KJK::Hyperion
 
 ; Permission is hereby granted, free of charge, to any person obtaining a copy
 ; of this software and associated documentation files (the "Software"), to deal
@@ -18,7 +18,6 @@
 ; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 ; SOFTWARE.
 
-cpu 486
 segment .text use32
 
 ; Note: the undecorated names are for Borland C++ (and possibly other compilers
@@ -66,4 +65,25 @@ __SEHLongJmp@8:
  mov edi, [ecx+20]
  jmp edx
 
+
+global SEHLongJmp_KeepEsp
+global __SEHLongJmp_KeepEsp@8
+SEHLongJmp_KeepEsp:
+__SEHLongJmp_KeepEsp@8:
+ ; return value
+ mov eax, [esp+8]
+
+ ; jump buffer
+ mov ecx, [esp+4]
+
+ ; restore the saved context
+ mov ebp, [ecx+0]
+; don't restore esp 
+; mov esp, [ecx+4]
+ mov edx, [ecx+8]
+ mov ebx, [ecx+12]
+ mov esi, [ecx+16]
+ mov edi, [ecx+20]
+ jmp edx
+
 ; EOF