struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / device / lib / pdk15 / __setjmp.s
blob4afa109b545cf04bb3c65767104ea3600a1097e9
1 ;--------------------------------------------------------------------------
2 ; __setjmp.s
4 ; Copyright (C) 2019, Philipp Klaus Krause
6 ; This library is free software; you can redistribute it and/or modify it
7 ; under the terms of the GNU General Public License as published by the
8 ; Free Software Foundation; either version 2, or (at your option) any
9 ; later version.
11 ; This library is distributed in the hope that it will be useful,
12 ; but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ; GNU General Public License for more details.
16 ; You should have received a copy of the GNU General Public License
17 ; along with this library; see the file COPYING. If not, write to the
18 ; Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
19 ; MA 02110-1301, USA.
21 ; As a special exception, if you link this library with other files,
22 ; some of which are compiled with SDCC, to produce an executable,
23 ; this library does not by itself cause the resulting executable to
24 ; be covered by the GNU General Public License. This exception does
25 ; not however invalidate any other reasons why the executable file
26 ; might be covered by the GNU General Public License.
27 ;--------------------------------------------------------------------------
29 .area DATA
30 ___setjmp_PARM_1::
31 .ds 2
32 _longjmp_PARM_1::
33 .ds 2
34 _longjmp_PARM_2::
35 .ds 2
37 .area CODE
39 ___setjmp::
40 mov.io a, sp
41 add a, #-1
42 mov p, a
43 idxm a, p
44 push af
45 dec p
46 idxm a, p
48 xch a, p
49 mov a, ___setjmp_PARM_1+0
50 xch a, p
52 idxm p, a
53 inc p
54 pop af
55 idxm p, a
57 inc p
58 mov.io a, sp
59 idxm p, a
60 clear p
61 ret #0
63 _longjmp::
64 mov a, _longjmp_PARM_1+0
65 add a, #2
66 mov p, a
67 idxm a, p
68 add a, #-2
69 mov.io sp, a
71 dec p
72 dec p
73 idxm a, p
74 push af
75 inc p
76 idxm a, p
78 xch a, p
79 mov.io a, sp
80 add a, #-1
81 xch a, p
82 idxm p, a
84 mov a, _longjmp_PARM_2+1
85 mov p, a
86 mov a, _longjmp_PARM_2+0
88 ceqsn a, p
89 ret
90 ceqsn a, #0
91 ret
92 ret #1