Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.1 KiB

  1. ;***
  2. ;ehprolog.asm - defines __EH_prolog
  3. ;
  4. ; Copyright (c) 1994-2001, Microsoft Corporation. All rights reserved.
  5. ;
  6. ;Purpose:
  7. ; EH prolog helper function. Sets up the frame for a C++ EH function
  8. ; with unwinds, by creating a link in the __except_list, and by setting
  9. ; up EBP as frame base pointer.
  10. ;
  11. ;Revision History:
  12. ; 10-27-94 LL Module created.
  13. ; 10-27-94 CFW Comments added.
  14. ; 01-11-95 SKS Remove MASM 5.X support
  15. ;
  16. ;*******************************************************************************
  17. title ehprolog.asm
  18. .386P
  19. .model FLAT
  20. ASSUME FS: FLAT
  21. PUBLIC __EH_prolog
  22. _TEXT SEGMENT
  23. __EH_prolog PROC NEAR
  24. push -1 ; State index
  25. push eax ; Push address of handler thunk
  26. mov eax, DWORD PTR fs:0
  27. push eax ; List link
  28. mov eax, DWORD PTR [esp+12] ; Load return address
  29. mov DWORD PTR fs:0, esp
  30. mov DWORD PTR [esp+12], ebp ; Save old ebp on the stack
  31. lea ebp, DWORD PTR [esp+12] ; Set ebp to the base of the frame
  32. push eax ; Push return addr on top of the stack
  33. ret 0 ; JMP [eax] would be bad on P6
  34. __EH_prolog ENDP
  35. _TEXT ENDS
  36. END