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

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

Removed _ prefix.

  • Property mode set to 100644
File size: 828 bytes
RevLine 
[4f508e6]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
[f40a309]6 .text
[4f508e6]7
[8325447]8 .xdef setjmp,longjmp
[4f508e6]9
[8325447]10setjmp: movea.l 4(a7),a0 | Get env pointer
[4f508e6]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
[8325447]16longjmp: move.w 8(a7),d0 | Get ret value
[4f508e6]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
[f40a309]26 .end
Note: See TracBrowser for help on using the repository browser.