home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c220 / 4.ddi / LIB / SRC / DOS.ASM < prev    next >
Encoding:
Assembly Source File  |  1990-12-16  |  2.2 KB  |  86 lines

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