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.

268 lines
6.5 KiB

  1. ;/*
  2. ; * Microsoft Confidential
  3. ; * Copyright (C) Microsoft Corporation 1988 - 1991
  4. ; * All Rights Reserved.
  5. ; */
  6. page 60,132
  7. name _msgret
  8. title C to Message Retriever
  9. ;-------------------------------------------------------------------
  10. ;
  11. ; MODULE: _msgret
  12. ;
  13. ; PURPOSE: Supplies an interface between C programs and
  14. ; the DOS 3.3 message retriever
  15. ;
  16. ; CALLING FORMAT:
  17. ; msgret(&inregs,&outregs);
  18. ;
  19. ; DATE: 5-21-87
  20. ;
  21. ;-------------------------------------------------------------------
  22. INCLUDE SYSMSG.INC ;PERMIT SYSTEM MESSAGE HANDLER DEFINITION ;AN000;
  23. MSG_UTILNAME <MEM> ;IDENTIFY THE COMPONENT ;AN000;
  24. ;-------------------------------------------------------------------
  25. ;-------------------------------------------------------------------
  26. _TEXT SEGMENT BYTE PUBLIC 'CODE'
  27. _TEXT ENDS
  28. _DATA SEGMENT WORD PUBLIC 'DATA'
  29. _DATA ENDS
  30. CONST SEGMENT WORD PUBLIC 'CONST'
  31. CONST ENDS
  32. _BSS SEGMENT WORD PUBLIC 'BSS'
  33. _BSS ENDS
  34. DGROUP GROUP CONST, _BSS, _DATA
  35. ASSUME CS: DGROUP, DS: DGROUP, SS: DGROUP, ES: NOTHING
  36. public data_sysloadmsg
  37. public data_sysdispmsg
  38. public data_sysgetmsg
  39. _DATA SEGMENT
  40. MSG_SERVICES <MSGDATA>
  41. MSG_SERVICES <LOADmsg,FARmsg>
  42. MSG_SERVICES <DISPLAYmsg,GETmsg,CHARmsg,NUMmsg>
  43. MSG_SERVICES <MEM.CLA,MEM.CLB,MEM.CL1,MEM.CL2,MEM.CTL> ;AN000;
  44. data_sysloadmsg proc far
  45. push bp ; save user's base pointer
  46. mov bp,sp ; set bp to current sp
  47. push di ; save some registers
  48. push si
  49. ; copy C inregs into proper registers
  50. mov di,[bp+4+4] ; fix di (arg 0)
  51. ;-------------------------------------------------------------------
  52. mov ax,[di+0ah] ; load di
  53. push ax ; the di value from inregs is now on stack
  54. mov ax,[di+00] ; get inregs.x.ax
  55. mov bx,[di+02] ; get inregs.x.bx
  56. mov cx,[di+04] ; get inregs.x.cx
  57. mov dx,[di+06] ; get inregs.x.dx
  58. mov si,[di+08] ; get inregs.x.si
  59. pop di ; get inregs.x.di from stack
  60. push bp ; save base pointer
  61. ;-------------------------------------------------------------------
  62. call sysloadmsg ; call the message retriever
  63. ;-------------------------------------------------------------------
  64. pop bp ; restore base pointer
  65. push di ; the di value from call is now on stack
  66. mov di,[bp+6+4] ; fix di (arg 1)
  67. mov [di+00],ax ; load outregs.x.ax
  68. mov [di+02],bx ; load outregs.x.bx
  69. mov [di+04],cx ; load outregs.x.cx
  70. mov [di+06],dx ; load outregs.x.dx
  71. mov [di+08],si ; load outregs.x.si
  72. lahf ; get flags into ax
  73. mov al,ah ; move into low byte
  74. mov [di+0ch],ax ; load outregs.x.cflag
  75. pop ax ; get di from stack
  76. mov [di+0ah],ax ; load outregs.x.di
  77. ;-------------------------------------------------------------------
  78. pop si ; restore registers
  79. pop di
  80. mov sp,bp ; restore sp
  81. pop bp ; restore user's bp
  82. ret
  83. data_sysloadmsg endp
  84. data_sysdispmsg proc far
  85. push bp ; save user's base pointer
  86. mov bp,sp ; set bp to current sp
  87. push di ; save some registers
  88. push si
  89. ; copy C inregs into proper registers
  90. mov di,[bp+4+4] ; fix di (arg 0)
  91. ;-------------------------------------------------------------------
  92. mov ax,[di+0ah] ; load di
  93. push ax ; the di value from inregs is now on stack
  94. mov ax,[di+00] ; get inregs.x.ax
  95. mov bx,[di+02] ; get inregs.x.bx
  96. mov cx,[di+04] ; get inregs.x.cx
  97. mov dx,[di+06] ; get inregs.x.dx
  98. mov si,[di+08] ; get inregs.x.si
  99. pop di ; get inregs.x.di from stack
  100. push bp ; save base pointer
  101. ;-------------------------------------------------------------------
  102. call sysdispmsg
  103. ;-------------------------------------------------------------------
  104. pop bp ; restore base pointer
  105. push di ; the di value from call is now on stack
  106. mov di,[bp+6+4] ; fix di (arg 1)
  107. mov [di+00],ax ; load outregs.x.ax
  108. mov [di+02],bx ; load outregs.x.bx
  109. mov [di+04],cx ; load outregs.x.cx
  110. mov [di+06],dx ; load outregs.x.dx
  111. mov [di+08],si ; load outregs.x.si
  112. lahf ; get flags into ax
  113. mov al,ah ; move into low byte
  114. mov [di+0ch],ax ; load outregs.x.cflag
  115. pop ax ; get di from stack
  116. mov [di+0ah],ax ; load outregs.x.di
  117. ;-------------------------------------------------------------------
  118. pop si ; restore registers
  119. pop di
  120. mov sp,bp ; restore sp
  121. pop bp ; restore user's bp
  122. ret
  123. data_sysdispmsg endp
  124. data_sysgetmsg proc far
  125. push bp ; save user's base pointer
  126. mov bp,sp ; set bp to current sp
  127. push di ; save some registers
  128. push si
  129. ; copy C inregs into proper registers
  130. mov di,[bp+4+4] ; fix di (arg 0)
  131. ;-------------------------------------------------------------------
  132. mov ax,[di+0ah] ; load di
  133. push ax ; the di value from inregs is now on stack
  134. mov ax,[di+00] ; get inregs.x.ax
  135. mov bx,[di+02] ; get inregs.x.bx
  136. mov cx,[di+04] ; get inregs.x.cx
  137. mov dx,[di+06] ; get inregs.x.dx
  138. mov si,[di+08] ; get inregs.x.si
  139. pop di ; get inregs.x.di from stack
  140. push bp ; save base pointer
  141. ;-------------------------------------------------------------------
  142. call sysgetmsg ; call the message retriever
  143. ;-------------------------------------------------------------------
  144. pop bp ; restore base pointer
  145. push di ; the di value from call is now on stack
  146. mov di,[bp+6+4] ; fix di (arg 1)
  147. push ax ; save ax
  148. mov [di+00],es ; load segregs.es
  149. mov [di+06],ds ; load outregs.ds
  150. pop ax ; restore ax
  151. pop di ; restore di
  152. push di ; save it
  153. mov di,[bp+8+4] ; fix di (arg 2)
  154. mov [di+00],ax ; load outregs.x.ax
  155. mov [di+02],bx ; load outregs.x.bx
  156. mov [di+04],cx ; load outregs.x.cx
  157. mov [di+06],dx ; load outregs.x.dx
  158. mov [di+08],si ; load outregs.x.si
  159. lahf ; get flags into ax
  160. mov al,ah ; move into low byte
  161. mov [di+0ch],ax ; load outregs.x.cflag
  162. pop ax ; get di from stack
  163. mov [di+0ah],ax ; load outregs.x.di
  164. ;-------------------------------------------------------------------
  165. pop si ; restore registers
  166. pop di
  167. mov sp,bp ; restore sp
  168. pop bp ; restore user's bp
  169. ret
  170. data_sysgetmsg endp
  171. include msgdcl.inc
  172. _DATA ends ; end code segment
  173. _TEXT SEGMENT
  174. assume cs:_TEXT
  175. public _sysdispmsg
  176. public _sysloadmsg
  177. public _sysgetmsg
  178. _sysdispmsg proc near
  179. call data_sysdispmsg
  180. ret
  181. _sysdispmsg endp
  182. _sysloadmsg proc near
  183. call data_sysloadmsg
  184. ret
  185. _sysloadmsg endp
  186. _sysgetmsg proc near
  187. call data_sysgetmsg
  188. ret
  189. _sysgetmsg endp
  190. _TEXT ENDS
  191. end
  192.