source: buchla-68k/orig/CLIBRARY/SETJMP.S@ 6099cac

Last change on this file since 6099cac was 3ae31e9, checked in by Thomas Lopatic <thomas@…>, 8 years ago

Imported original source code.

  • Property mode set to 100755
File size: 864 bytes
Line 
1* ------------------------------------------------------------------------------
2* setjmp.s -- Unix(tm) compatible setjmp(env) and longjmp(env,ret)
3* Version 3 -- 1987-06-16 -- D.N. Lynx Crowe
4* ------------------------------------------------------------------------------
5*
6 .text
7*
8 .xdef _setjmp,_longjmp
9*
10_setjmp: movea.l 4(a7),a0 * Get env pointer
11 move.l (a7),(a0) * Put return address in env
12 movem.l d1-d7/a1-a7,4(a0) * Save registers in env
13 moveq.l #0,d0 * Set return value to 0
14 rts * Return to caller
15*
16_longjmp: move.w 8(a7),d0 * Get ret value
17 bne lj1 * Jump if non-zero
18*
19 moveq.l #1,d0 * Force return value to 1
20*
21lj1: movea.l 4(a7),a0 * Get env pointer
22 movem.l 4(a0),d1-d7/a1-a7 * Restore registers from env
23 move.l (a0),(a7) * Get return address from env
24 rts * Return to caller
25*
26 .end
Note: See TracBrowser for help on using the repository browser.