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

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

Converted assembly language files.

  • Property mode set to 100644
File size: 831 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
[f40a309]8 .xdef _setjmp,_longjmp
[4f508e6]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
[f40a309]26 .end
Note: See TracBrowser for help on using the repository browser.