home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD1.bin / gnu / src / amiga / libnix-0.7-src.lha / libnix-0.7 / sources / nix / setjmp / longjmp.c next >
Encoding:
Text File  |  1994-12-12  |  452 b   |  10 lines

  1. asm(".text                  ;" /* doing this in c is very hard */
  2.     ".even                  ;"
  3.     ".globl _longjmp        ;"
  4.     "_longjmp:              ;"
  5.     "  movel  sp@(4),a0     ;" /* get address of jmp_buf */
  6.     "  movel  sp@(8),d0     ;" /* get returncode */
  7.     "  moveml a0@(4),#0xfcfc;" /* restore all registers (including sp) except scratch */
  8.     "  movel  a0@,sp@       ;" /* restore returnaddress */
  9.     "  rts                  ;");
  10.