setjump.inc 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. {
  2. $Id$
  3. This file is part of the Free Pascal run time library.
  4. Copyright (c) 2003 by the Free Pascal development team.
  5. SetJmp and LongJmp implementation for exception handling
  6. See the file COPYING.FPC, included in this distribution,
  7. for details about the copyright.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. **********************************************************************}
  12. function setjmp(var S : jmp_buf) : longint;assembler;[Public, alias : 'FPC_SETJMP'];nostackframe;
  13. label FPC_SETJMP;
  14. asm
  15. stmia r0,{v1-v6, sl, fp, sp, lr}
  16. mov r0,#0
  17. mov pc,lr
  18. end;
  19. procedure longjmp(var S : jmp_buf;value : longint);assembler;[Public, alias : 'FPC_LONGJMP'];
  20. asm
  21. mov ip, r0
  22. movs r0, r1
  23. moveq r0, #1
  24. ldmia ip,{v1-v6, sl, fp, sp, pc}
  25. end;
  26. {
  27. $Log$
  28. Revision 1.6 2005-02-14 17:13:21 peter
  29. * truncate log
  30. Revision 1.5 2005/01/04 16:22:05 florian
  31. + added nostackframe directive
  32. }