home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / sigm / vol181 / setjmp.hq / SETJMP.H
Encoding:
C/C++ Source or Header  |  1985-02-10  |  1.5 KB  |  36 lines

  1. /****************************************************************************/
  2. /*                                        */
  3. /*            L o n g j u m p   H e a d e r   F i l e            */
  4. /*            ---------------------------------------            */
  5. /*                                        */
  6. /*    Copyright 1982 by Digital Research.  All rights reserved.        */
  7. /*                                        */
  8. /*    Long jumps on the 68K are implemented as follows:              */
  9. /*                                        */
  10. /*        1).    Routine "setjmp" is called to setup a special         */
  11. /*            buffer for return.  The return address, stack         */
  12. /*            pointer and frame pointer are saved.  This allows   */
  13. /*            the calling program to do the proper number of         */
  14. /*            "pops".                                */
  15. /*                                        */
  16. /*        2).    At some later time, the procedure "longjmp" is        */
  17. /*            called.  The programmer sees a return from the        */
  18. /*            previous "setjmp" as the result.            */
  19. /*                                        */
  20. /*    Calling sequence:                            */
  21. /*                                        */
  22. /*        #include    <setjmp.h>    (definitions)            */
  23. /*        jmp_buf     env;    (define a buffer for saved stuff)        */
  24. /*                                        */
  25. /*        setjmp(env);                            */
  26. /*    a:                                    */
  27. /*                                        */
  28. /*        longjmp(env,val);                        */
  29. /*                                        */
  30. /*    Setjmp returns a WORD of 0 on first call, and "val" on the         */
  31. /*    subsequent "longjmp" call.  The longjmp call causes execution to    */
  32. /*    resume at "a:" above.                            */
  33. /*                                        */
  34. /****************************************************************************/
  35. typedef    long    jmp_buf[13];
  36.