Leaked source code of windows server 2003
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.

72 lines
1.5 KiB

  1. subttl emstack.asm - Emulator Stack Management Macros
  2. page
  3. ;***
  4. ;emstack.asm - Emulator Stack Management Area
  5. ;
  6. ; Microsoft Confidential
  7. ; Copyright (c) Microsoft Corporation 1991
  8. ; All Rights Reserved
  9. ;
  10. ;Purpose:
  11. ; Handles emulator stack.
  12. ;
  13. ;Revision History:
  14. ;
  15. ; [] 09/05/91 TP Initial 32-bit version.
  16. ;
  17. ;*******************************************************************************
  18. ;POPSTret: pops the stack and returns. Uses esi.
  19. POPSTret macro reg
  20. local stackwrap
  21. IFB <reg>
  22. mov esi,EMSEG:[CURstk]
  23. _popreg equ esi
  24. ELSE
  25. _popreg equ reg
  26. ENDIF
  27. mov EMSEG:[_popreg].bTag,bTAG_EMPTY
  28. NextStackElem _popreg,stackwrap
  29. mov EMSEG:[CURstk],_popreg
  30. ret
  31. Wrap&stackwrap:
  32. mov EMSEG:[CURstk],BEGstk
  33. ret
  34. endm
  35. ;NextStackElem: Given pST(0) = [CURstk] in reg, returns pST(1)
  36. ;Requires NextStackWrap macro with same arguments
  37. NextStackElem macro reg,stackwrap
  38. cmp reg,INITstk ;JWM
  39. jae Wrap&stackwrap
  40. add reg,Reg87Len
  41. Cont&stackwrap:
  42. endm
  43. NextStackWrap macro reg,stackwrap
  44. Wrap&stackwrap:
  45. mov reg,BEGstk ;JWM
  46. jmp Cont&stackwrap
  47. endm
  48. ;PrevStackElem: Given pST(0) = [CURstk] in reg, returns new pST(0)
  49. ;after a push onto on the stack.
  50. ;Requires PrevStackWrap macro with same arguments
  51. PrevStackElem macro reg,stackwrap
  52. cmp reg,BEGstk ;JWM
  53. jbe Wrap&stackwrap
  54. sub reg,Reg87Len
  55. Cont&stackwrap:
  56. endm
  57. PrevStackWrap macro reg,stackwrap
  58. Wrap&stackwrap:
  59. mov reg,INITstk ;JWM
  60. jmp Cont&stackwrap
  61. endm