Counter Strike : Global Offensive Source Code
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.

76 lines
1.2 KiB

  1. PROC_TEMPLATE MACRO procname, retpop, mod, internal, ord
  2. .errb <retpop> ;; require non-blank
  3. include cmacros.inc
  4. include xlib.inc
  5. externFP __&mod&dynlink
  6. sBegin Data
  7. Data&procname PROCD_STRUC <LinkProc&procname>
  8. sEnd Data
  9. sBegin Code
  10. assumes cs,Code
  11. assumes ds,Data
  12. ;; the data structure
  13. Ptr&procname label word
  14. .errnz pcData-($-Ptr&procname)
  15. dw DataOFFSET Data&procname
  16. IF UNLINK
  17. .errnz pcLinkProc-($-Ptr&procname)
  18. dw CodeOFFSET LinkProc&procname
  19. ENDIF
  20. .errnz pcRetF-($-Ptr&procname)
  21. bogus proc far
  22. IF retpop
  23. retf retpop*2
  24. ELSE
  25. retf
  26. dw 0
  27. ENDIF
  28. bogus endp
  29. .errnz pcStr-($-Ptr&procname)
  30. IFNB <ord>
  31. db 0
  32. dw ord, 0
  33. ELSE
  34. db "&procname&",0
  35. ENDIF
  36. ;; the dynlinking stub proc
  37. LinkProc&procname proc far
  38. lea bx, Ptr&procname
  39. jmp __&mod&dynlink
  40. LinkProc&procname endp
  41. ;; the glue routine
  42. IFNB <internal>
  43. IFDIF <internal>,<->
  44. internal proc far
  45. public internal
  46. jmp Data&procname.pdPtr
  47. internal endp
  48. ELSE
  49. procname proc far
  50. public procname
  51. jmp Data&procname.pdPtr
  52. procname endp
  53. ENDIF
  54. ELSE
  55. procname proc far
  56. public procname
  57. jmp Data&procname.pdPtr
  58. procname endp
  59. ENDIF
  60. sEnd Code
  61. end
  62. ENDM
  63.