source: trunk/libs/newlib/src/newlib/libc/machine/tic80/setjmp.S @ 444

Last change on this file since 444 was 444, checked in by satin@…, 6 years ago

add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc

File size: 850 bytes
Line 
1/* These are predefined by new versions of GNU cpp.  */
2
3#ifndef __USER_LABEL_PREFIX__
4#define __USER_LABEL_PREFIX__ _
5#endif
6
7/* ANSI concatenation macros.  */
8
9#define CONCAT1(a, b) CONCAT2(a, b)
10#define CONCAT2(a, b) a ## b
11
12/* Use the right prefix for global labels.  */
13
14#define SYM(x) CONCAT1 (__USER_LABEL_PREFIX__, x)
15
16        .global SYM (setjmp)
17        .global SYM (_setjmp)
18        .global SYM (longjmp)
19
20        .section  .text,"x"
21        .align 4
22SYM (_setjmp): 
23SYM (setjmp):
24        st.d    0(r2),r20
25        st.d    8(r2),r22
26        st.d    16(r2),r24
27        st.d    24(r2),r26
28        st.d    32(r2),r28
29        st.d    40(r2),r30
30        st      48(r2),r1
31        jsr     r31(r0),r0
32         addu   0,r0,r2
33
34        .section  .text,"x"
35        .align 4
36SYM (longjmp):
37        ld.d    0(r2),r20
38        ld.d    8(r2),r22
39        ld.d    16(r2),r24
40        ld.d    24(r2),r26
41        ld.d    32(r2),r28
42        ld.d    40(r2),r30
43        bcnd    L1,r4,ne0.w
44         ld     48(r2),r1
45
46        jsr     r31(r0),r0
47         addu   1,r0,r2
48L1:
49        jsr     r31(r0),r0
50         addu   r4,r0,r2
Note: See TracBrowser for help on using the repository browser.