home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari FTP
/
ATARI_FTP_0693.zip
/
ATARI_FTP_0693
/
Mint
/
mntlib25.zoo
/
lattice
/
setjmp.s
< prev
next >
Wrap
Text File
|
1992-06-15
|
853b
|
41 lines
;
; setjmp.cpp
;
text
even
xdef _setjmp
_setjmp:
move.l 4(sp),a0 ; address of jmp_buf[]
move.l (sp),(a0) ; save return address
movem.l d2-d7/a2-a7,4(a0) ; save registers d2-d7/a2-a7
clr.l d0 ; return value is 0
rts
xdef _longjmp
xref ___mint
_longjmp:
IFD __MSHORT__
tst.w ___mint ; see if MiNT is active
ELSE
tst.l ___mint
ENDC
beq.s NOMINT ; no -- do not call sigreturn
move.w #$11a,-(sp) ; Psigreturn() system call
trap #1 ; (ignored if not in a sig handler)
addq.w #2,sp
NOMINT:
move.l 4(sp),a0 ; address of jmp_buf[]
IFD __MSHORT__
move.w 8(sp),d0 ; value to return
ELSE
move.l 8(sp),d0 ; value to return
ENDC
bne.s L1 ; may not be 0
move.l #1,d0
L1:
movem.l 4(a0),d2-d7/a2-a7 ; restore saved reggies
move.l (a0),(sp) ; and the saved return address
rts
end