1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
!# ZSVJMP, ZDOJMP -- Set up a jump (non-local goto) by saving the processor
!# registers in the buffer jmpbuf. A subsequent call to ZDOJMP restores
!# the registers, effecting a call in the context of the procedure which
!# originally called ZSVJMP, but with the new status code. These are Fortran
!# callable procedures.
!#
!# (SUN/UNIX sparc version)
.seg "text"
.global _zsvjmp_
.global _zdojmp_
!# The following has nothing to do with ZSVJMP, and is included here
!# only because this assembler module is loaded with every process.
!# This code sets the value of the symbol MEM (the Mem common) to zero,
!# setting the origin for IRAF pointers to zero rather than some
!# arbitrary value, and ensuring that the MEM common is aligned for
!# all datatypes as well as page aligned. A further advantage is that
!# references to NULL pointers will cause a memory violation.
.global _mem_
_mem_ = 0
!# The following requires a jmpbuf of length at least 6 ints.
.proc 0
_zsvjmp_:
save %sp, -0x60, %sp
call _sigblock
clr %o0
st %o0, [%i0 + 0x8]
st %i1, [%i0 + 0x14]
clr %o0
st %o0, [%i1]
st %i7, [%i0]
st %fp, [%i0 + 0x4]
add %i0, 0xc, %o1
call _sigstack
clr %o0
ret
restore %g0, 0x0, %o0
.proc 0
_zdojmp_:
save %sp, -0x40, %sp
ta 0x3
ld [%i0 + 0x4], %fp
sub %fp, 0x60, %sp
call _sigsetmask
ld [%i0 + 0x8], %o0
add %i0, 0xc, %o0
call _sigstack
clr %o1
ld [%i0 + 0x14], %o0
ld [%i1], %i1
st %i1, [%o0]
ld [%i0], %i7
ret
restore %i1, 0x0, %o0
.seg "data"
|