home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c221 / 5.ddi / MWHC.005 / Z2 < prev    next >
Encoding:
Text File  |  1992-12-09  |  2.3 KB  |  89 lines

  1. small_m = 1
  2. mach386 = 1
  3. GOC = 0
  4.         include model
  5.     cseg    calldos_
  6. ; {*********************************************************************
  7. ; (C) Copyright      1986;  Franklin L. DeRemer,   Thomas J. Pennello,
  8. ;               MetaWare Incorporated;  Santa Cruz, CA 95060.
  9. ; This program is the unpublished property and trade secret of the above
  10. ; three.  It is to be utilized solely under license from MetaWare and it
  11. ; is to be maintained on a confidential basis for internal  company  use
  12. ; only.  The  security    and  protection  of  the program is paramount to
  13. ; maintenance of the trade secret status.  It is to  be  protected  from
  14. ; disclosure  to  unauthorized parties, both within the Licensee company
  15. ; and outside, in a manner not less stringent than that utilized for Li-
  16. ; censee's own proprietary  internal  information.   No  copies  of  the
  17. ; Source or Object Code are to leave the premises of Licensee's business
  18. ; except  in  strict accordance with the license agreement signed by Li-
  19. ; censee with MetaWare.
  20. ; *********************************************************************}
  21. ;
  22. ;  MetaWare Pascal Runtime Support: Interface to zenix Compatible Calls
  23. ;
  24. _MWDOSREGS    segment dword common 'DATA'
  25. Rax        dd    0
  26. Rbx        dd    0
  27. Rcx        dd    0
  28. Rdx        dd    0
  29. Rsi        dd    0
  30. Rdi        dd    0
  31. Rds        dd    0
  32. Res        dd    0
  33. Flags        dw    0
  34. _MWDOSREGS    ends
  35.  
  36. DGROUP    group    _MWDOSREGS
  37.  
  38. CALLDOS     PROC    FAR
  39.         publab    calldos
  40.         push    esi
  41.         push    edi
  42.         push    ebx
  43.         push    ebp
  44.         push    ds
  45.         push    es    ; Save es in case we're in small_data mode.
  46.         ASSUME    ds:DGROUP
  47.         mov    eax,Rax    ; set ax..dx, si, di.
  48.         mov    ebx,Rbx
  49.         mov    ecx,Rcx
  50.         mov    edx,Rdx
  51.         mov    esi,Rsi
  52.         mov    edi,Rdi
  53.         push    Res
  54.         pop    es    ; Set es.
  55.  
  56.         push    ds    ; Save DS before call.
  57.         push    Rds
  58.         pop    ds    ; set ds now.
  59.         clc        ; Because we set errno if it's set upon return.
  60.         call    _mwint21 ; call MS-DOS.
  61.         
  62. continue:       pop    ebp    ; Old value of DS; BP IS NOW DESTROYED!!
  63.         push    ds    ; save returned DS.
  64.         mov    ds,bp    ; DS is now restored.
  65.         pop    Rds    ; pop ds.
  66.  
  67.         push    es
  68.         pop    Res
  69.         mov    Rax,eax
  70.         mov    Rbx,ebx
  71.         mov    Rcx,ecx
  72.         mov    Rdx,edx
  73.         mov    Rsi,esi
  74.         mov    Rdi,edi
  75.         pushf
  76.         pop    Flags
  77.         ; Now we've moved all results into register table.
  78.         pop    es
  79.         pop    ds
  80.         pop    ebp
  81.         pop    ebx
  82.         pop    edi
  83.         pop    esi
  84.         return
  85. CALLDOS     endp
  86.  
  87.         endcseg calldos_
  88.         end
  89.