home *** CD-ROM | disk | FTP | other *** search
/ World of Shareware - Software Farm 2 / wosw_2.zip / wosw_2 / CPROG / ISC366.ZIP / ISC / ISCSERVE.ASM < prev   
Assembly Source File  |  1993-09-01  |  2KB  |  91 lines

  1. ;////////////////////////////////////////////////////////////////////////////
  2. ;//                                                                        //
  3. ;//            File: IscServe.asm                                          //
  4. ;//            restarted on: 8/10/92                                       //
  5. ;//                                                                        //
  6. ;////////////////////////////////////////////////////////////////////////////
  7. ;//                                                                        //
  8. ;//                              V3.6x                                     //
  9. ;//                           -----------                                  //
  10. ;//                                                                        //
  11. ;////////////////////////////////////////////////////////////////////////////
  12.  
  13. .MODEL large,C ;// DO NOT CHANGE MEMORY MODEL!!!
  14.  
  15. EXTRN C ISCDispatch:PROC
  16.  
  17.  
  18. .DATA
  19.  
  20. ThunkMailboxOFF dw 0
  21. ThunkMailboxSEG dw 0
  22.  
  23. .CODE
  24.  
  25. PUBLIC ThunkSize
  26. PUBLIC ThunkSet
  27. PUBLIC ThunkGetID
  28.  
  29. ;;// The actual thunk.
  30. ;;//
  31. Thunk PROC C
  32.  
  33. Thunk_start:
  34.  
  35.  
  36.       cli
  37.       push ax dx ds
  38.  
  39.       mov ax, DGroup
  40.       mov ds, ax
  41.  
  42. LABEL Thunk_off_loc WORD
  43.       mov ax, 0
  44. LABEL Thunk_seg_loc WORD
  45.       mov dx, 0
  46.  
  47.       mov ThunkMailboxOFF, ax
  48.       mov ThunkMailboxSEG, dx
  49.  
  50.       pop ds dx ax
  51.  
  52.       jmp ISCDispatch
  53.  
  54. Thunk_end:
  55.  
  56. Thunk ENDP
  57.  
  58.  
  59. ;;// gets This as parameter, returns far pointer to Thunk.
  60. ;;//
  61. ThunkSet PROC C ThisParam:DWORD
  62.  
  63.       les bx, ThisParam
  64.  
  65.       mov Thunk_off_loc[1], bx
  66.       mov Thunk_seg_loc[1], es
  67.  
  68.       mov ax, offset cs:Thunk_start
  69.       mov dx, cs
  70.  
  71.       ret
  72. ThunkSet ENDP
  73.  
  74. ;;// returns the size of the thunk.
  75. ;;//
  76. ThunkSize PROC C
  77.       mov ax, offset Thunk_end- offset Thunk_start
  78.       ret
  79. ThunkSize ENDP
  80.  
  81. ;;// returns this.
  82. ThunkGetID PROC C
  83.  
  84.       mov ax, ThunkMailboxOFF
  85.       mov dx, ThunkMailboxSEG
  86.  
  87.       ret
  88. ThunkGetID ENDP
  89.  
  90. END
  91.