source: buchla-68k/lib700/setjmp.s@ 7c5def4

Last change on this file since 7c5def4 was 8325447, checked in by Thomas Lopatic <thomas@…>, 7 years ago

Removed _ prefix.

  • Property mode set to 100644
File size: 828 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
10setjmp: 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
16longjmp: 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.