home *** CD-ROM | disk | FTP | other *** search
- small_m = 1
- mach386 = 1
- GOC = 0
- include model
- cseg calldos_
- ; {*********************************************************************
- ; (C) Copyright 1986; Franklin L. DeRemer, Thomas J. Pennello,
- ; MetaWare Incorporated; Santa Cruz, CA 95060.
- ; This program is the unpublished property and trade secret of the above
- ; three. It is to be utilized solely under license from MetaWare and it
- ; is to be maintained on a confidential basis for internal company use
- ; only. The security and protection of the program is paramount to
- ; maintenance of the trade secret status. It is to be protected from
- ; disclosure to unauthorized parties, both within the Licensee company
- ; and outside, in a manner not less stringent than that utilized for Li-
- ; censee's own proprietary internal information. No copies of the
- ; Source or Object Code are to leave the premises of Licensee's business
- ; except in strict accordance with the license agreement signed by Li-
- ; censee with MetaWare.
- ; *********************************************************************}
- ;
- ; MetaWare Pascal Runtime Support: Interface to zenix Compatible Calls
- ;
- _MWDOSREGS segment dword common 'DATA'
- Rax dd 0
- Rbx dd 0
- Rcx dd 0
- Rdx dd 0
- Rsi dd 0
- Rdi dd 0
- Rds dd 0
- Res dd 0
- Flags dw 0
- _MWDOSREGS ends
-
- DGROUP group _MWDOSREGS
-
- CALLDOS PROC FAR
- publab calldos
- push esi
- push edi
- push ebx
- push ebp
- push ds
- push es ; Save es in case we're in small_data mode.
- ASSUME ds:DGROUP
- mov eax,Rax ; set ax..dx, si, di.
- mov ebx,Rbx
- mov ecx,Rcx
- mov edx,Rdx
- mov esi,Rsi
- mov edi,Rdi
- push Res
- pop es ; Set es.
-
- push ds ; Save DS before call.
- push Rds
- pop ds ; set ds now.
- clc ; Because we set errno if it's set upon return.
- call _mwint21 ; call MS-DOS.
-
- continue: pop ebp ; Old value of DS; BP IS NOW DESTROYED!!
- push ds ; save returned DS.
- mov ds,bp ; DS is now restored.
- pop Rds ; pop ds.
-
- push es
- pop Res
- mov Rax,eax
- mov Rbx,ebx
- mov Rcx,ecx
- mov Rdx,edx
- mov Rsi,esi
- mov Rdi,edi
- pushf
- pop Flags
- ; Now we've moved all results into register table.
- pop es
- pop ds
- pop ebp
- pop ebx
- pop edi
- pop esi
- return
- CALLDOS endp
-
- endcseg calldos_
- end
-