summaryrefslogtreecommitdiffhomepage
path: root/src/setjmp/nt32
diff options
context:
space:
mode:
Diffstat (limited to 'src/setjmp/nt32')
-rw-r--r--src/setjmp/nt32/longjmp.s9
-rw-r--r--src/setjmp/nt32/setjmp.s14
2 files changed, 23 insertions, 0 deletions
diff --git a/src/setjmp/nt32/longjmp.s b/src/setjmp/nt32/longjmp.s
new file mode 100644
index 0000000..095a47f
--- /dev/null
+++ b/src/setjmp/nt32/longjmp.s
@@ -0,0 +1,9 @@
+.text
+.globl ___longjmp
+.globl __longjmp
+.globl _longjmp
+
+___longjmp:
+__longjmp:
+_longjmp:
+ test %edx, %edx # is val zero?
diff --git a/src/setjmp/nt32/setjmp.s b/src/setjmp/nt32/setjmp.s
new file mode 100644
index 0000000..1865f0c
--- /dev/null
+++ b/src/setjmp/nt32/setjmp.s
@@ -0,0 +1,14 @@
+.text
+.globl ___setjmp
+.globl __setjmp
+.globl _setjmp
+
+___setjmp:
+__setjmp:
+_setjmp:
+ pop (%ecx) # return address
+ mov %esp, 0x04(%ecx) # caller's stack pointer
+ push (%ecx) # restore own stack pointer
+
+ xor %eax, %eax
+ ret