home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c082_122 / 1.ddi / WINLBSRC.ZIP / SETJMP.ASM < prev    next >
Encoding:
Assembly Source File  |  1992-06-10  |  1.0 KB  |  44 lines

  1. ;[]-----------------------------------------------------------------[]
  2. ;|      SETJMP.ASM -- entry points for Windows versions of setjmp()  |
  3. ;[]-----------------------------------------------------------------[]
  4.  
  5. ;
  6. ;       C/C++ Run Time Library - Version 5.0
  7. ;       Copyright (c) 1987, 1992 by Borland International
  8. ;       All Rights Reserved.
  9.  
  10.         INCLUDE RULES.ASI
  11.  
  12.         assume cs:_TEXT
  13.  
  14. public  SETJMP
  15. public  LONGJMP
  16.  
  17. extrn   CATCH : far
  18. extrn   THROW : far
  19.  
  20. _TEXT   segment
  21.  
  22. SETJMP  proc DIST
  23.         jmp CATCH       ; the catch buffer used by Windows is smaller
  24.                         ; than the one used by TC, so we can simply
  25.                         ; call the Windows function with our buffer
  26. SETJMP  endp
  27.  
  28. LONGJMP proc DIST
  29.         push    bp
  30.         mov     bp, sp
  31.         pushf
  32.         cmp     word ptr [bp+6], 1      ; generates carry if param == 0
  33.         adc     word ptr [bp+6], 0      ; if it was zero now it's one
  34.         popf
  35.         pop     bp
  36.         jmp THROW
  37. LONGJMP endp
  38.  
  39. ends
  40.  
  41. end
  42.