home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari FTP
/
ATARI_FTP_0693.zip
/
ATARI_FTP_0693
/
Mint
/
mntlib32.zoo
/
lattice
/
setjmp.s
< prev
next >
Wrap
Text File
|
1993-05-23
|
1KB
|
64 lines
INCLUDE inc.i
;
; setjmp.cpp
;
XFUNC
IF _REGARG
xdef @setjmp
ELSE
xdef _setjmp
ENDC
TEXT
IF _REGARG
@setjmp:
ELSE
_setjmp:
move.l 4(sp),a0 ; address of jmp_buf[]
ENDC
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
XFUNC
IF _REGARG
xdef @longjmp
ELSE
xdef _longjmp
ENDC
XDATA
xref ___mint
TEXT
IF _REGARG
@longjmp:
ELSE
_longjmp:
ENDC
IF _SHORT
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[]
IF _SHORT
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