setjump.inc 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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'];
  13. asm
  14. stmia r0,{v1-v6, sl, fp, sp, lr}
  15. mov r0,#0
  16. end;
  17. procedure longjmp(var S : jmp_buf;value : longint);assembler;[Public, alias : 'FPC_LONGJMP'];
  18. asm
  19. mov ip, r0
  20. movs r0, r1
  21. moveq r0, #1
  22. ldmia ip,{v1-v6, sl, fp, sp, pc}
  23. end;
  24. {
  25. $Log$
  26. Revision 1.3 2004-01-20 21:01:57 florian
  27. * fixed setjump
  28. * fixed syscalls
  29. Revision 1.2 2003/09/03 14:09:37 florian
  30. * arm fixes to the common rtl code
  31. * some generic math code fixed
  32. * ...
  33. Revision 1.1 2003/08/21 16:41:54 florian
  34. * empty dummy files
  35. + [long|set]jmp implemented
  36. }