summaryrefslogtreecommitdiff
path: root/newlib/libc/machine/z8k/setjmp.S
diff options
context:
space:
mode:
authorPikalaxALT <pikalaxalt@gmail.com>2017-12-15 09:38:53 -0500
committerPikalaxALT <pikalaxalt@gmail.com>2017-12-15 09:39:34 -0500
commitf95a4a932476be2ba99e2fd081e8d2bc6ea12813 (patch)
tree75f67192cb2d7b7b575c94edda318e475239b63c /newlib/libc/machine/z8k/setjmp.S
parentf60aca96985e68c7d8a52eb7bc955fb80e132f73 (diff)
Import newlib and create makefile
Diffstat (limited to 'newlib/libc/machine/z8k/setjmp.S')
-rw-r--r--newlib/libc/machine/z8k/setjmp.S49
1 files changed, 49 insertions, 0 deletions
diff --git a/newlib/libc/machine/z8k/setjmp.S b/newlib/libc/machine/z8k/setjmp.S
new file mode 100644
index 0000000..6a76641
--- /dev/null
+++ b/newlib/libc/machine/z8k/setjmp.S
@@ -0,0 +1,49 @@
+
+#ifdef __Z8001__
+ segm
+
+ .global _setjmp
+_setjmp:
+ ldl rr2,@rr14 ! fetch pc
+ ldl @rr6,rr2 ! save it
+ ldl rr6(4),rr10
+ ldl rr6(8),rr12 ! and the other special regs
+ ldl rr6(12),rr14
+ ldk r2,#0
+ ret t
+
+ .globl _longjmp
+
+_longjmp:
+ ld r2,r5 ! get return value
+ ldl rr4,rr6(0)
+ ldl rr10,rr6(4)
+ ldl rr12,rr6(8)
+ ldl rr14,rr6(12)
+ jp @rr4
+#else
+ unseg
+
+ .global _setjmp
+_setjmp:
+ ld r2,@r15 ! fetch pc
+ ld @r7,r2 ! save it
+ ldl r7(4),rr10
+ ldl r7(8),rr12 ! and the other special regs
+ ldl r7(12),rr14
+ ldk r2,#0
+ ret t
+
+ .globl _longjmp
+
+_longjmp:
+ ld r2,r6 ! get return value
+ ld r4,@r7
+ ldl rr10,rr7(4)
+ ldl rr12,rr7(8)
+ ldl rr14,rr7(12)
+ jp @rr4
+
+#endif
+
+