;       SCCSID = @(#)mmpha.inc  6.46 92/03/11                                                          00002  DELETED(OLD) 00001
; ****************************************************************************
; *                                                                          *
; *                       IBM/Microsoft Confidential                         *
; *                                                                          *
; *                 Copyright (c) IBM Corporation  1987, 1990                *
; *                 Copyright (c) Microsoft Corp.  1987, 1990                *
; *                           All Rights Reserved                            *
; *                                                                          *
; ****************************************************************************
;
;   mmpha.inc - MMIO Macro Hooks for MASM

;   IFDEF Legend:
;
;       1) NOT_RELEASED - Written but not ready for release
;       2) INACTIVE     - Temporarily turned off
;       3) MMIOPH       - Active hook
;       4) BUGGY        - Undetermined error when active

include perfhook.inc
include rasmacro.inc

SIZETHUNKSEF EQU        48h

IFNDEF  SISData
        ReferGlobal     SISData,BYTE
ENDIF

;****************************************************************************
;
;       MACHINE EXCEPTIONS: Internal Interface  -  Major Code 03h
;
;****************************************************************************

MMPHR0PreExceptionTest  MACRO                   ; In-Line: task\trap.asm
                        IFDEF   MMIOPH          ; 6.78
                        TestTraceFlatCS RAS_MC_MACHINEEXCEPT    ; maj code on?
                        jz      trapR0PreTraceDone
                        TestTraceFlatCS PERFTRACE               ; Tracing On ?
                        jnz     MMPHR0ExceptionHook             ; yes-> jump
                        ENDIF
                        ENDM

MMPHR0PreException      MACRO                   ; In-line: task\trap.asm
                        IFDEF   MMIOPH           ; 6.78
                        Procedure MMPHR0ExceptionHook

                        ; fake a near 32-bit call (push the return address) !!!
                        push    offset FLAT:trapR0PreTraceDone

                        ArgVar  tras_trapnum,DWORD      ; Trap Entry Frame
                        ArgVar  tras_errcode,DWORD
                        ArgVar  tras_eip,DWORD
                        ArgVar  tras_cs,DWORD
                        ArgVar  tras_eflags,DWORD

                        EnterProc
                        SaveReg <eax,es>

                        DosContext es
                        sub     esp,2                   ;    pop ES uses 4 bytes
                        push    es:SISData.SIS_MMIOBase
                        pop     es

                        mov     eax,[tras_trapnum]
                        inc     eax                     ; set minor code
                        mov     ah,RAS_MC_MACHINEEXCEPT ; load major code
                        mov     es:[MAJMIN_CODE],ax     ; DEKKO: maj/min code

                        mov     eax,[tras_errcode]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Error Code

                        mov     eax,[tras_eip]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: EIP

                        mov     eax,[tras_cs]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: CS

                        mov     eax,[tras_eflags]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: EFlags

                        RestoreReg <es,eax>
                        LeaveProc

                        ; Exception hook complete.  Do NOT pop off the ArgVars.
                        ret

                        EndProc MMPHR0ExceptionHook
                        ENDIF
                        ENDM

MMPHR3PreExceptionTest  MACRO                   ; In-Line: task\trap.asm
                        IFDEF   MMIOPH          ; 6.78
                        TestTraceFlatCS RAS_MC_MACHINEEXCEPT    ; maj code on?
                        jz      trapR3PreTraceDone
                        TestTraceFlatCS PERFTRACE               ; Tracing On ?
                        jnz     MMPHR3ExceptionHook             ; yes-> jump
                        ENDIF
                        ENDM

MMPHR3PreException      MACRO                   ; In-line: task\trap.asm
                        IFDEF   MMIOPH           ; 6.78
                        Procedure MMPHR3ExceptionHook

                        ; fake a near 32-bit call (push the return address) !!!
                        push    offset FLAT:trapR3PreTraceDone

                        ArgVar  tras_trapnum,DWORD      ; Trap Entry Frame
                        ArgVar  tras_errcode,DWORD
                        ArgVar  tras_eip,DWORD
                        ArgVar  tras_cs,DWORD
                        ArgVar  tras_eflags,DWORD

                        EnterProc
                        SaveReg <eax,es>

                        DosContext es
                        sub     esp,2                   ;    pop ES uses 4 bytes
                        push    es:SISData.SIS_MMIOBase
                        pop     es

                        mov     eax,[tras_trapnum]
                        inc     eax                     ; set minor code
                        mov     ah,RAS_MC_MACHINEEXCEPT ; load major code
                        mov     es:[MAJMIN_CODE],ax     ; DEKKO: maj/min code

                        mov     eax,[tras_errcode]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Error Code

                        mov     eax,[tras_eip]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: EIP

                        mov     eax,[tras_cs]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: CS

                        mov     eax,[tras_eflags]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: EFlags

                        RestoreReg <es,eax>
                        LeaveProc

                        ; Exception hook complete.  Do NOT pop off the ArgVars.
                        ret

                        EndProc MMPHR3ExceptionHook
                        ENDIF
                        ENDM

;****************************************************************************
;
;        INTERRUPTS: Internal Interface  -  Major Code 04h
;
;****************************************************************************

MMPHPreintIRQRouter     MACRO                   ; In-Line: dev\int.asm
                        IFDEF   MMIOPH          ; 6.82

;;      When invoked the AL register contains the major code, the DL register
;;      will contain the minor code for the hook. Also the test against the
;;      major code has already been done.

                        TestTrace32     PERFTRACE       ;    test if tracing
                        jz      ras0401                 ;    no - then jump

                        SaveReg <es,dx>
                        sub     esp,2                   ;    pop ES uses 4 bytes
                        push    es:SISData.SIS_MMIOBase ;    load ES with DEKKO
                        pop     es                      ;       card address

                        mov     dh,al                   ;    build maj/min code
                        mov     es:[MAJMIN_CODE],dx     ; DEKKO: maj/min codes

                        RestoreReg <dx,es>
                        pop     ebx                     ; restore ebx pushed in
                                                        ;  irt_pretrace
                        jmp     irt_PreTraceDone        ;    skip systrace call
        ras0401:
                        ENDIF
                        ENDM

MMPHPostintIRQRouter    MACRO   LOCATION        ; In-Line: dev\int.asm
						;160610         
                        IFDEF   MMIOPH          ; 6.83

;;      When invoked the AL register contains the major code, the DL register
;;      will contain the minor code for the hook. Also the test against the
;;      major code has already been done.

                        TestTrace32     PERFTRACE       ;    test if tracing
                        jz      ras0481&LOCATION        ;    no - then jump
 							; 160610

                        SaveReg <es,dx>
                        sub     esp,2                   ;    pop ES uses 4 bytes
                        push    es:SISData.SIS_MMIOBase ;    load ES with DEKKO
                        pop     es                      ;       card address

                        mov     dh,al                   ;    build maj/min code
                        mov     es:[MAJMIN_CODE],dx     ; DEKKO: maj/min codes

                        RestoreReg <dx,es>
                        pop     ebx                     ; restore ebx pushed in
                                                        ;  irt_posttrace
                        jmp     irt_PostTraceDone_&LOCATION  ;160610
                                                        ;skip systrace call
        ras0481&LOCATION:                               ; 160610
                        ENDIF
                        ENDM

;****************************************************************************
;
;       TASKING: External Interface  -  Major Code 10h
;
;****************************************************************************

MMPHPreDOSCREATETHREAD  MACRO                   ; SCI: task\tkthrd.c
                        IFDEF   MMIOPH          ; 6.66  @6.82
                        SetupTest32     10h,ras1001,1001h

                        SaveReg <eax>
                        mov     eax,ss:[esp+SIZETHUNKSEF+10h]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Transfer Addr

                        mov     eax,ss:[esp+SIZETHUNKSEF+08h]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Stack Addr
                        RestoreReg <eax>
        ras1001:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSCWAIT         MACRO                   ; SCI: task\task.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest       10h,ras1002,1002h
        ras1002:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSEnterCritSec  MACRO                   ; In-Line: task\schedapi.asm
                        IFDEF   MMIOPH          ; 6.62  @6.90
                        SetupTest       10h,ras1003,1003h
        ras1003:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSIEXECPGM      MACRO                   ; SCI: task\exec.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest       10h,ras1004,1004h

                        SaveReg <ds,di>
                        mov     ds,[bp].sreg_ds         ;     get shadow DS
                        mov     di,dx                   ; ds:di -> ProgramName
                        SendAsciiz      1004            ; DEKKO: Program Name
                        RestoreReg <di,ds>
        ras1004:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSEXIT          MACRO                   ; SCI: task\tkforce.c
                        IFDEF   MMIOPH          ; 6.70
                        SetupTest32     10h,ras1005,1005h
        ras1005:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSExitCritSec   MACRO                   ; In-Line: task\schedapi.asm
                        IFDEF   MMIOPH          ; 6.62  @6.90
                        SetupTest       10h,ras1006,1006h
        ras1006:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSEXITLIST      MACRO                   ; SCI: task\tkextlst.c
                        IFDEF   MMIOPH          ; 6.70
                        SetupTest32     10h,ras1007,1007h
        ras1007:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSSETPRTY       MACRO                   ; SCI: task\schedapi.asm
                        IFDEF   MMIOPH          ; 6.62  @6.80
                        SetupTest       10h,ras1008,1008h

                        SendAsDouble    dx
                                                        ; DEKKO: Scope
                        push    ax
                        mov     ax,bx
                        xor     ah,ah
                        SendAsDouble    ax              ; DEKKO: Priority Delta

                        mov     ax,bx
                        xor     al,al
                        SendAsDouble    ax              ; DEKKO: Priority Class
                        pop     ax

                        SendAsDouble    ax              ; DEKKO: Procs/Thrd Id

        ras1008:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSKILLPROCESS   MACRO                   ; SCI: task\task.asm
                        IFDEF   MMIOPH          ; 6.62  @6.80
                        SetupTest       10h,ras1009,1009h

                        SendAsDouble    bx              ; DEKKO: Process Id

        ras1009:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSRESUMETHREAD  MACRO                   ; SCI: task\task.asm
                        IFDEF   MMIOPH          ; 6.66
                        SetupTest32     10h,ras100B,100Bh

                        push    eax
                        movzx   eax,ss:[esp+SIZETHUNKSEF+4] ; AA04235
                        mov     es:[PERF_DATA_4],eax        ; DEKKO: Thread Id
                        pop     eax
        ras100B:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSSUSPENDTHREAD MACRO                   ; SCI: task\task.asm
                        IFDEF   MMIOPH          ; 6.66
                        SetupTest32     10h,ras100C,100Ch

                        push    eax
                        movzx   eax,ss:[esp+SIZETHUNKSEF+4] ; AA04235
                        mov     es:[PERF_DATA_4],eax        ; DEKKO: Thread Id
                        pop     eax
        ras100C:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSISETCP        MACRO                   ; SCI: filesys\codepg.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest       10h,ras100D,100Dh

                        SendAsDouble    bx              ; DEKKO: CodePage ID
        ras100D:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSGETCP         MACRO                   ; SCI: filesys\codepg.asm
                        IFDEF   MMIOPH          ; 6.145
                        SetupTest       39h,ras3901,3901h
        ras3901:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOS32DEBUG       MACRO                   ; SCI: task\dbger.c
                        IFDEF   MMIOPH          ; 6.76
                        SetupTest32     10h,ras100E,100Eh
        ras100E:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOS32EXITLIST    MACRO                   ; SCI: task\tkextlst.c
                        IFDEF   MMIOPH          ; 6.66
                        SetupTest32     10h,ras100F,100Fh

                        push    eax
                        movzx   eax,ss:[esp+8]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Function Order

                        movzx   eax,ss:[esp+4]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Routine Address
                        pop     eax
        ras100F:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSGetInfoSeg    MACRO                   ; In-Line: filesys\getset2.asm
                        IFDEF   MMIOPH          ; 6.62  @6.90
                        SetupTest       10h,ras1010,1010h
        ras1010:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSGETPID        MACRO                   ; SCI: task\tasksubr.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest       10h,ras1011,1011h
        ras1011:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSGETPPID       MACRO                   ; SCI: task\tkv1api.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest       10h,ras1012,1012h
        ras1012:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSGETPRTY       MACRO                   ; SCI: task\schedapi.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest       10h,ras1013,1013h

                        mov     es:[PERF_DATA],ax       ; DEKKO: Process Id

                        mov     es:[PERF_DATA],dx       ; DEKKO: Scope
        ras1013:
                        ExitMMPH
                        ENDIF
                        ENDM

;; 1014 - PreDOSGetInfoBlocks ......... see \drv6\src\doscall1\dc1mmpha.inc

MMPHPreDOSR2STACKREALLOC MACRO                  ; SCI: task\tkv1api.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest       10h,ras1015,1015h
        ras1015:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOS32WAITTHREAD  MACRO                   ; SCI: task\tkthrd.c
                        IFDEF   MMIOPH          ; 6.74  @6.82
                        SetupTest32     10h,ras1016,1016h

                        SaveReg <eax,edi>

                        mov     edi,ss:[esp+SIZETHUNKSEF+0Ch]
                        mov     eax,ds:[edi]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Thread Id

                        mov     eax,ss:[esp+SIZETHUNKSEF+10h]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Option

                        RestoreReg <edi,eax>
        ras1016:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSICALLBACK     MACRO                   ; SCI: task\tkv1api.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest       10h,ras1017,1017h
        ras1017:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOS32CREATETHREAD MACRO                  ; SCI: task\tkthrd.c
                        IFDEF   MMIOPH          ; 6.66  @6.82
                        SetupTest32     10h,ras1018,1018h

                        push    eax
                        mov     eax,ss:[esp+SIZETHUNKSEF+18h]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Stack Size

                        mov     eax,ss:[esp+SIZETHUNKSEF+14h]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Flags

                        mov     eax,ss:[esp+SIZETHUNKSEF+10h]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Arg Ptr

                        mov     eax,ss:[esp+SIZETHUNKSEF+0Ch]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Starting EIP
                        pop     eax
        ras1018:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSRETFORWARD    MACRO                   ; SCI: task\tkv1api.asm
                        IFDEF   MMIOPH          ; 6.72
                        SetupTest       10h,ras1019,1019h
        ras1019:
                        ExitMMPH
                        ENDIF
                        ENDM
;
; Macro MMPHPreTPROFTICK added as part of defect 150667
MMPHPreTPROFTICK	MACRO                   ; dev\int.asm
   			local use_gdt, use_vm86, use_ldt, tpt9
			IFDEF	MMIOPH
			SetupTest32	10h,ras101A,101Ah
			SaveReg	<ds,fs,edi,ebx,ecx>
		
			GDTContext  <fs>, eax
			mov	ax,  [ebp].isf_cs   	; CS of 1st level ISF
			mov	ecx, [ebp].isf_eip 	; EIP of 1st level ISF
			mov	ebx, [ebp].isf_eflag	; EFLAGS 

			bt	ebx, 17			; check VM bit
			jc	use_vm86		; use VM86 conversion

			bt	ax,  2			; test sel's TI bit
			jc 	use_ldt			; using LDT

	use_gdt:					; using GDT
			and	eax, 0fff8h		; mask off TI & RPL 
			mov	ebx, dword ptr fs:[eax].d_limit+1  ;low 24 bits
			mov	bl,  fs:[eax].d_extaddr            ;hi 8 bits
			ror	ebx, 8			; (EBX)=base of CS sel
			add	ebx, ecx		; (EAX)=CS:EIP
	
			mov	al,  fs:[eax].d_attr    ; attribute byte
			and	al,  040h		; 16-bit/32-bit ind
			or	al,  020h		; AL=0x10 0000b
			jmp	tpt9

	use_vm86:					; in real mode
			movzx	ebx, ax			; (EBX)=CS
			shl	ebx, 4			; (EBX)=CS*16
			movzx	ecx, cx			; (ECX)=EIP	
		 	add	ebx, ecx		; (ECX)=CS*16 + EIP	
			xor	eax, eax		; AL=0000 0000b
			jmp	tpt9


	use_ldt:					; using LDT
			FlatContext <ds>, ebx 
			sldt	di
			and	edi, 0fff8h
			mov	ebx, dword ptr fs:[edi].d_limit+1 ;low 24 bits
			mov	bl,  fs:[edi].d_extaddr 	  ;hi 8 bits
			ror	ebx, 8			; (EBX)=base of LDT

			and	eax, 0fff8h		; Mask off TI & RPL
			add	eax, ebx		; (EAX)=linear addr CS
			mov	ebx, dword ptr [eax].d_limit+1
			mov	bl,  [eax].d_extaddr
			ror	ebx, 8
			add	ebx, ecx		; (EAX)=linear addr

			mov	al,  [eax].d_attr	; attribute byte
			and	al,  040h		; 16-bit/32-bit ind
			or	al,  020h		; AL=0x10 0000b

	tpt9:
			mov	es:[PERF_DATA_4], ebx   ; Instruction pointer
			shr	al,  5			; AL=0000  00xxb
			FlatContext <ds>, ebx		; remove later
			xor	ebx, ebx
			mov	bx,  word ptr [InterruptLevel]
			shl	ebx, 16
			mov 	bl,  al
			mov	es:[PERF_DATA_4], ebx   ; code size
			RestoreReg <ecx,ebx,edi,fs,ds>

	ras101A:
			ExitMMPH
			ENDIF
			ENDM				; End of  defect 150667



MMPHPostDOSCREATETHREAD MACRO                   ; SCI: task\tkthrd.c
                        IFDEF   MMIOPH          ; 6.66  @6.108
                        SetupTest32     10h,ras1081,1081h

                        SaveReg <esi,ds>                                     ;AA03898

                        mov     si,ss:[esp+SIZETHUNKSEF+0eh]  ; Selector     ;AA03898
                        mov     ds,si                                        ;AA03898
                        mov     si,ss:[esp+SIZETHUNKSEF+0ch]  ; Offset
                        movzx   esi,ds:[si]                                  ;AA03898,AA04148
                        mov     es:[PERF_DATA_4],esi    ; DEKKO: Thread Id   ;AA03898

                        RestoreReg <ds,esi>                                  ;AA03898
        ras1081:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSCWAIT        MACRO                   ; SCI: task\task.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest       10h,ras1082,1082h
        ras1082:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSEnterCritSec MACRO                   ; In-Line: task\schedapi.asm
                        IFDEF   MMIOPH          ; 6.62  @6.90
                        SetupTest       10h,ras1083,1083h
        ras1083:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSIEXECPGM     MACRO                   ; SCI: task\exec.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest       10h,ras1084,1084h

                        SendAsDouble    ax,dx           ; DEKKO: ResultCodes

        ras1084:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSEXIT         MACRO                   ; SCI: task\tkforce.c
                        IFDEF   MMIOPH          ; 6.70
                        SetupTest32     10h,ras1085,1085h
        ras1085:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSExitCritSec  MACRO                   ; In-Line: task\schedapi.asm
                        IFDEF   MMIOPH          ; 6.62  @6.90
                        SetupTest       10h,ras1086,1086h
        ras1086:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSEXITLIST     MACRO                   ; SCI: task\tkextlst.c
                        IFDEF   MMIOPH          ; 6.70
                        SetupTest32     10h,ras1087,1087h
        ras1087:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSSETPRTY      MACRO                   ; SCI: task\schedapi.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest       10h,ras1088,1088h
        ras1088:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSKILLPROCESS  MACRO                   ; SCI: task\task.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest       10h,ras1089,1089h
        ras1089:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSRESUMETHREAD MACRO                   ; SCI: task\task.asm
                        IFDEF   MMIOPH          ; 6.68
                        SetupTest32     10h,ras108B,108Bh
        ras108B:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSSUSPENDTHREAD MACRO                  ; SCI: task\task.asm
                        IFDEF   MMIOPH          ; 6.68
                        SetupTest32     10h,ras108C,108Ch
        ras108C:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSISETCP       MACRO                   ; SCI: filesys\codepg.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest       10h,ras108D,108Dh

                        SendAsDouble    ax              ; DEKKO: Return Code
        ras108D:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSGETCP        MACRO                   ; SCI: filesys\codepg.asm
                        IFDEF   MMIOPH          ; 6.145
                        SetupTest       39h,ras3981,3981h
        ras3981:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOS32DEBUG      MACRO                   ; SCI: task\dbger.c
                        IFDEF   MMIOPH          ; 6.76
                        SetupTest32     10h,ras108E,108Eh

                        SendAsDouble    ax              ; DEKKO: Return Code
        ras108E:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOS32EXITLIST   MACRO                   ; SCI: task\tkextlst.c
                        IFDEF   MMIOPH          ; 6.66
                        SetupTest32     10h,ras108F,108Fh

                        SendAsDouble    ax              ; DEKKO: Return Code
        ras108F:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSGetInfoSeg   MACRO                   ; In-Line: filesys\getset2.asm
                        IFDEF   MMIOPH          ; 6.62  @6.90
                        SetupTest       10h,ras1090,1090h
        ras1090:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSGETPID       MACRO                   ; SCI: task\tasksubr.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest       10h,ras1091,1091h

                        mov     es:[PERF_DATA],ax    ; DEKKO: Process Id
                        mov     es:[PERF_DATA],bx    ; DEKKO: Thread Id
                        mov     es:[PERF_DATA],cx    ; DEKKO: Parent Process Id

        ras1091:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSGETPPID      MACRO                   ; SCI: task\tkv1api.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest       10h,ras1092,1092h
        ras1092:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSGETPRTY      MACRO                   ; SCI: task\schedapi.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest       10h,ras1093,1093h

                        mov     es:[PERF_DATA],bx       ; DEKKO: Priority
                        mov     es:[PERF_DATA],ax       ; DEKKO: Return Code

        ras1093:
                        ExitMMPH
                        ENDIF
                        ENDM

;; 1094 - PostDOSGetInfoBlocks ........ see \drv6\src\doscall1\dc1mmpha.inc

MMPHPostDOSR2STACKREALLOC MACRO                 ; SCI: task\tkv1api.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest       10h,ras1095,1095h
        ras1095:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOS32WAITTHREAD MACRO                   ; SCI: task\tkthrd.c
                        IFDEF   MMIOPH          ; 6.74  @6.82
                        SetupTest32     10h,ras1096,1096h

                        SaveReg <eax,edi>
                        mov     edi,ss:[esp+SIZETHUNKSEF+0Ch]
                        mov     eax,ds:[edi]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Thread Id
                        RestoreReg <edi,eax>

                        SendAsDouble    ax              ; DEKKO: Return Code
        ras1096:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSICALLBACK    MACRO                   ; SCI: task\tkv1api.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest       10h,ras1097,1097h
        ras1097:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOS32CREATETHREAD MACRO                 ; SCI: task\tkthrd.c
                        IFDEF   MMIOPH          ; 6.66  @6.82
                        SetupTest32     10h,ras1098,1098h

                        SaveReg <eax,edi>
                        mov     edi,ss:[esp+SIZETHUNKSEF+0Ch] ; load TID address
                        mov     eax,ds:[edi]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Thread Id
                        RestoreReg <edi,eax>

                        SendAsDouble    ax              ; DEKKO: Return Code
        ras1098:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSRETFORWARD   MACRO                   ; SCI: task\tkv1api.asm
                        IFDEF   MMIOPH          ; 6.72
                        SetupTest       10h,ras1099,1099h
        ras1099:
                        ExitMMPH
                        ENDIF
                        ENDM


;****************************************************************************
;
;       TASKING: Internal Interface  -  Major Code 12h
;
;****************************************************************************

MMPHPreThreadDispatch   MACRO                   ; In-Line: task\sutil.asm
                        IFDEF   MMIOPH          ; 6.62  @6.106
;;
;;      This hook is sepecial in that it ONLY checks that performance tracing
;;      is activated. There is NO testing of major code 12h.
;;
                        SetupTest32     PERFTRACE,ras1201,1201h
                        push    bx

                        mov     es:[PERF_DATA],ax       ; DEKKO: Process ID

                        mov     bx,[ecx].TCBOrdinal
                        mov     es:[PERF_DATA],bx       ; DEKKO: Thread ID

;;                      mov     bh,[ecx].TCBPriClass    ; (BH) = priority class  ;AA03962
;;                      mov     bl,[ecx].TCBPriLevel    ; (BL) = priority level  ;AA03962
                        mov     bx,[ecx].TCBPriority    ; (BX) = Calc priority   ;AA03962
                        mov     es:[PERF_DATA],bx       ; DEKKO: Priority

                        pop     bx
        ras1201:
                        ExitMMPH
                        ENDIF
                        ENDM

;; 1202 - PreExitListCall ............. see \drv6\h\mmph.h

MMPHPreIdleTask         MACRO                   ; In-Line: task\sutil.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest32     12h,ras1203,1203h
        ras1203:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostIdleTask        MACRO                   ; In-Line: task\sutil.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest32     12h,ras1283,1283h
        ras1283:
                        ExitMMPH
                        ENDIF
                        ENDM


;****************************************************************************
;
;       PROGRAM EXECUTION CONTROL: External Interface  -  Major Code 14h
;
;****************************************************************************

MMPHPreDOSLOADMODULE    MACRO                   ; SCI: memory\ldrrun.asm
                        IFDEF   MMIOPH          ; 6.68
                        SetupTest       14h,ras1401,1401h

                        SaveReg <ds,di>
                        mov     ds,[bp].sreg_es            ; load segment
                        if ?sci_sreg_di eq ?SCI_IN_USE     ; if DI is shadowed,
                           mov     di,[bp].sreg_di         ;   load offset
                        endif
                        SendAsciiz      1401               ; DEKKO: Module Name
                        RestoreReg <di,ds>
        ras1401:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSFREEMODULE    MACRO                   ; SCI: memory\ldrsubr.c
                        IFDEF   MMIOPH          ; 6.68  @6.76
                        SetupTest32     14h,ras1402,1402h

                        SaveReg <eax>
                        movzx   eax,word ptr ss:[esp+SIZETHUNKSEF+04h] ;AA04521
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: ModuleHandle
                        RestoreReg <eax>
        ras1402:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSGETMODHANDLE  MACRO                   ; SCI: memory\ldrrun.asm
                        IFDEF   MMIOPH          ; 6.68
                        SetupTest       14h,ras1404,1404h
        ras1404:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSGETMODNAME    MACRO                   ; SCI: memory\ldrrun.asm
                        IFDEF   MMIOPH          ; 6.68
                        SetupTest       14h,ras1405,1405h
        ras1405:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSGetEnv        MACRO                   ; In-Line: task\tasksubr.asm
                        IFDEF   MMIOPH          ; 6.68  @6.90
                        SetupTest       14h,ras1406,1406h
        ras1406:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSGetMachineMode MACRO                  ; In-Line: filesys\getset2.asm
                        IFDEF   MMIOPH          ; 6.68  @6.90
                        SetupTest       14h,ras1407,1407h
        ras1407:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSGETVERSION    MACRO                   ; SCI: task\subr.asm
                        IFDEF   MMIOPH          ; 6.68
                        SetupTest       14h,ras1408,1408h
        ras1408:
                        ExitMMPH
                        ENDIF
                        ENDM

;; 1409 - PreDOSQAppType .............. see \drv6\src\doscall1\dc1mmpha.inc

;; 140A - PreDOSScanEnv ............... see \drv6\src\doscall1\dc1mmpha.inc

MMPHPreDOS32QUERYPROCADDR MACRO                 ; SCI: memory\ldrsubr.c
                        IFDEF   MMIOPH          ; 6.74  @6.82
                        SetupTest32     14h,ras140B,140Bh

                        SaveReg <eax,edi>

                        mov     edi,ss:[esp+SIZETHUNKSEF+14h]
                        SendAsciiz32    140B            ; DEKKO: Proc Name

                        mov     ax,ss:[esp+SIZETHUNKSEF+10h]
                        SendAsDouble    ax              ; DEKKO: Ordinal

                        mov     ax,ss:[esp+SIZETHUNKSEF+0Ch]
                        SendAsDouble    ax              ; DEKKO: Module Handle

                        RestoreReg <edi,eax>
        ras140B:
                        ExitMMPH
                        ENDIF
                        ENDM


MMPHPostDOSLOADMODULE   MACRO                   ; SCI: memory\ldrrun.asm
                        IFDEF   MMIOPH          ; 6.68  @6.80
                        SetupTest       14h,ras1481,1481h

                        SendAsDouble    bx              ; DEKKO: Module Handle

        ras1481:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSFREEMODULE   MACRO                   ; SCI: memory\ldrsubr.c
                        IFDEF   MMIOPH          ; 6.68
                        SetupTest32     14h,ras1482,1482h
        ras1482:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSGETMODHANDLE MACRO                   ; SCI: memory\ldrrun.asm
                        IFDEF   MMIOPH          ; 6.68
                        SetupTest       14h,ras1484,1484h
        ras1484:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSGETMODNAME   MACRO                   ; SCI: memory\ldrrun.asm
                        IFDEF   MMIOPH          ; 6.68
                        SetupTest       14h,ras1485,1485h
        ras1485:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSGetEnv       MACRO                   ; In-Line: task\tasksubr.asm
                        IFDEF   MMIOPH          ; 6.68  @6.90
                        SetupTest       14h,ras1486,1486h
        ras1486:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSGetMachineMode MACRO                 ; In-Line: filesys\getset2.asm
                        IFDEF   MMIOPH          ; 6.68  @6.90
                        SetupTest       14h,ras1487,1487h
        ras1487:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSGETVERSION   MACRO                   ; SCI: task\subr.asm
                        IFDEF   MMIOPH          ; 6.68
                        SetupTest       14h,ras1488,1488h

                        mov     es:[PERF_DATA],ax       ; DEKKO: Maj/Min Version

        ras1488:
                        ExitMMPH
                        ENDIF
                        ENDM

;; 1489 - PostDOSQAppType ............. see \drv6\src\doscall1\dc1mmpha.inc

;; 148A - PostDOSScanEnv .............. see \drv6\src\doscall1\dc1mmpha.inc

MMPHPostDOS32QUERYPROCADDR MACRO                ; SCI: memory\ldrsubr.c
                        IFDEF   MMIOPH          ; 6.74  @6.82
                        SetupTest32     14h,ras148B,148Bh

                        SaveReg <eax,edi>
                        mov     edi,ss:[esp+SIZETHUNKSEF+18h]
                        mov     eax,ds:[edi]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Proc Addr
                        RestoreReg <edi,eax>

                        SendAsDouble    ax              ; DEKKO: Return Code
        ras148B:
                        ExitMMPH
                        ENDIF
                        ENDM


;****************************************************************************
;
;   IPC (Signals, Semaphores, Pipes): External Interface - Major Code 18h
;
;****************************************************************************

MMPHPreDOSHoldSignal    MACRO                   ; SCI: task\sig.asm
                        IFDEF   MMIOPH          ; 6.68  @6.83
                        SetupTest       18h,ras1801,1801h

                        mov     es:[PERF_DATA],ax       ; DEKKO: Action Code
        ras1801:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSSENDSIGNAL    MACRO                   ; SCI: task\sig.asm
                        IFDEF   MMIOPH          ; 6.68
                        SetupTest       18h,ras1802,1802h

                        push    ax
                        xor     ah,ah                ;    want AL only
                        mov     es:[PERF_DATA],ax    ; DEKKO: Signal Number
                        mov     es:[PERF_DATA],cx    ; DEKKO: Child Session Id
                        pop     ax

        ras1802:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSSETSIGHANDLER MACRO                   ; SCI: task\sig.asm
                        IFDEF   MMIOPH          ; 6.68
                        SetupTest       18h,ras1803,1803h

                        push    ax
                        xor     ah,ah                   ;    want AL only
                        mov     es:[PERF_DATA],ax       ; DEKKO: Signal Number

                        mov     al,bl                   ;    want bl only
                        mov     es:[PERF_DATA],ax       ; DEKKO: Action
                        pop     ax
        ras1803:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSMAKEPIPE      MACRO                   ; SCI: filesys\pipe.asm
                        IFDEF   MMIOPH          ; 6.68
                        SetupTest       18h,ras1804,1804h
        ras1804:
                        ExitMMPH
                        ENDIF
                        ENDM

;; 1805 - PreDOSSemClear .............. see \drv6\src\doscall1\dc1mmpha.inc

;; 1806 - PreDOSSemRequest ............ see \drv6\src\doscall1\dc1mmpha.inc

;; 1807 - PreDOSSemSet ................ see \drv6\src\doscall1\dc1mmpha.inc

MMPHPreDOSSEMSETWAIT    MACRO                   ; SCI: task\sem.asm
                        IFDEF   MMIOPH          ; 6.68  @6.78
                        SetupTest       18h,ras1808,1808h

                        SendAsDouble    bx,ax           ; DEKKO: Sem Handle

        ras1808:
                        ExitMMPH
                        ENDIF
                        ENDM

;; 1809 - PreDOSSemWait ............... see \drv6\src\doscall1\dc1mmpha.inc

MMPHPreDOSMuxSemWait    MACRO                   ; In-Line: task\muxsem.asm
                        IFDEF   MMIOPH          ; 6.68  @6.82
                        SetupTest       18h,ras180A,180Ah
        ras180A:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSCLOSESEM      MACRO                   ; SCI: task\syssem.asm
                        IFDEF   MMIOPH          ; 6.68  @6.78
                        SetupTest       18h,ras180B,180Bh

                        SendAsDouble bx,ax              ; DEKKO: Sem Handle

        ras180B:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSCREATESEM     MACRO                   ; SCI: task\syssem.asm
                        IFDEF   MMIOPH          ; 6.70
                        SetupTest       18h,ras180C,180Ch

                        SaveReg <ds,di>
                        mov     ds,[bp].sreg_ds         ;    get shadow DS
                        if ?sci_sreg_si eq ?SCI_IN_USE  ; if SI is shadowed,
                           mov     di,[bp].sreg_si      ;   set DI = shadow SI
                        else                            ; otherwise,
                           mov     di,si                ;   set DI = real SI
                        endif
                        SendAsciiz      180C            ; DEKKO: Sem Name
                        RestoreReg <di,ds>
        ras180C:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSOPENSEM       MACRO                   ; SCI: task\syssem.asm
                        IFDEF   MMIOPH          ; 6.70
                        SetupTest       18h,ras180D,180Dh

                        SaveReg <ds,di>
                        mov     ds,[bp].sreg_ds         ; get shadow DS
                        if ?sci_sreg_si eq ?SCI_IN_USE  ; if SI is shadowed,
                           mov     di,[bp].sreg_si      ;   set DI = shadow SI
                        else                            ; otherwise,
                           mov     di,si                ;   set DI = real SI
                        endif
                        SendAsciiz      180D            ; DEKKO: Sem Name
                        RestoreReg <di,ds>
        ras180D:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOS32ADDMUXWAITSEM MACRO                 ; SCI: task\semverif.c
                        IFDEF   MMIOPH          ; 6.76  @6.82
                        SetupTest32     18h,ras180F,180Fh

                        SaveReg <eax>

                        mov     eax,ss:[esp+SIZETHUNKSEF+08h]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Sem Handle

                        mov     eax,ss:[esp+SIZETHUNKSEF+0Ch]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Sem Record Ptr

                        RestoreReg <eax>
        ras180F:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSCALLNMPIPE    MACRO                   ; SCI: filesys\nampipe1.asm
                        IFDEF   MMIOPH          ; 6.76
                        SetupTest       18h,ras1810,1810h

                        SaveReg <ds,di>

                        mov     ds,[bp].sreg_ds         ; get shadow DS
                        mov     di,dx
                        SendAsciiz      1810            ; DEKKO: PipeName

                        SendAsDouble    cx              ; DEKKO: InBufferLen

                        mov     di,word ptr [bp].kstk_args+8
                        SendAsDouble    di              ; DEKKO: OutBufferLen

                        RestoreReg <di,ds>
        ras1810:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOS32CLOSEEVENTSEM MACRO                 ; SCI: task\semverif.c
                        IFDEF   MMIOPH          ; 6.76  @6.82
                        SetupTest32     18h,ras1812,1812h

                        SaveReg <eax>
                        mov     eax,ss:[esp+SIZETHUNKSEF+08h]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Sem Handle
                        RestoreReg <eax>
        ras1812:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOS32CLOSEMUTEXSEM MACRO                 ; SCI: task\semverif.c
                        IFDEF   MMIOPH          ; 6.76  @6.82
                        SetupTest32     18h,ras1813,1813h

                        SaveReg <eax>
                        mov     eax,ss:[esp+SIZETHUNKSEF+08h]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Sem Handle
                        RestoreReg <eax>
        ras1813:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOS32CLOSEMUXWAITSEM MACRO               ; SCI: task\semverif.c
                        IFDEF   MMIOPH          ; 6.76  @6.82
                        SetupTest32     18h,ras1814,1814h

                        SaveReg <eax>
                        mov     eax,ss:[esp+SIZETHUNKSEF+08h]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: SemHandle
                        RestoreReg <eax>
        ras1814:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSCONNECTNMPIPE MACRO                   ; SCI: filesys\nampipe1.asm
                        IFDEF   MMIOPH          ; 6.70  @6.80
                        SetupTest       18h,ras1815,1815h

                        SendAsDouble    dx              ; DEKKO: Pipe Handle
        ras1815:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOS32CREATEEVENTSEM MACRO                ; SCI: task\semverif.c
                        IFDEF   MMIOPH          ; 6.76  @6.82
                        SetupTest32     18h,ras1816,1816h

                        SaveReg <eax,edi>

                        mov     edi,ss:[esp+SIZETHUNKSEF+0Ch]
                        SendAsciiz32    1816            ; DEKKO: Sem Name

                        mov     eax,ss:[esp+SIZETHUNKSEF+14h]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Attributes

                        mov     eax,ss:[esp+SIZETHUNKSEF+18h]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Initial State

                        RestoreReg <edi,eax>
        ras1816:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOS32CREATEMUTEXSEM MACRO                ; SCI: task\semverif.c
                        IFDEF   MMIOPH          ; 6.76  @6.82
                        SetupTest32     18h,ras1817,1817h

                        SaveReg <eax,edi>

                        mov     edi,ss:[esp+SIZETHUNKSEF+0Ch]
                        SendAsciiz32    1817            ; DEKKO: Sem Name

                        mov     eax,ss:[esp+SIZETHUNKSEF+14h]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Attributes

                        mov     eax,ss:[esp+SIZETHUNKSEF+18h]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: InitialState

                        RestoreReg <edi,eax>
        ras1817:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOS32CREATEMUXWAITSEM MACRO              ; SCI: task\semverif.c
                        IFDEF   MMIOPH          ; 6.76  @6.82
                        SetupTest32     18h,ras1818,1818h

                        SaveReg <eax,edi>

                        mov     edi,ss:[esp+SIZETHUNKSEF+0Ch]
                        SendAsciiz32    1818            ; DEKKO: Sem Name

                        mov     eax,ss:[esp+SIZETHUNKSEF+14h]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Sem Rec Entries

                        mov     eax,ss:[esp+SIZETHUNKSEF+18h]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Sem Rec Ptr

                        mov     eax,ss:[esp+SIZETHUNKSEF+1Ch]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Attribs

                        RestoreReg <edi,eax>
        ras1818:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSDISCONNECTNMPIPE MACRO                ; SCI: filesys\nampipe1.asm
                        IFDEF   MMIOPH          ; 6.70  @6.80
                        SetupTest       18h,ras1819,1819h

                        SendAsDouble    dx              ; DEKKO: Pipe Handle
        ras1819:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSMAKENMPIPE    MACRO                   ; SCI: filesys\nampipe1.asm
                        IFDEF   MMIOPH          ; 6.70
                        SetupTest       18h,ras181A,181Ah

                        SaveReg <ds,di>
                        mov     ds,[bp].sreg_ds         ; get shadow DS
                        mov     di,dx                   ; ds:di -> File Name
                        SendAsciiz      181A            ; DEKKO: File Name Buff
                        RestoreReg <di,ds>
        ras181A:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOS32OPENEVENTSEM MACRO                  ; SCI: task\semverif.c
                        IFDEF   MMIOPH          ; 6.76  @6.82
                        SetupTest32     18h,ras181B,181Bh

                        SaveReg <eax,edi>

                        mov     edi,ss:[esp+SIZETHUNKSEF+0Ch]
                        SendAsciiz32    181B            ; DEKKO: Sem Name

                        mov     edi,ss:[esp+SIZETHUNKSEF+10h]
                        mov     eax,ds:[edi]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Sem Handle

                        RestoreReg <edi,eax>
        ras181B:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOS32OPENMUTEXSEM MACRO                  ; SCI: task\semverif.c
                        IFDEF   MMIOPH          ; 6.76  @6.82
                        SetupTest32     18h,ras181C,181Ch

                        SaveReg <eax,edi>

                        mov     edi,ss:[esp+SIZETHUNKSEF+0Ch]
                        SendAsciiz32    181C            ; DEKKO: Sem Name

                        mov     edi,ss:[esp+SIZETHUNKSEF+10h]
                        mov     eax,ds:[edi]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Sem Handle

                        RestoreReg <edi,eax>
        ras181C:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOS32OPENMUXWAITSEM MACRO                ; SCI: task\semverif.c
                        IFDEF   MMIOPH          ; 6.76  @6.82
                        SetupTest32     18h,ras181D,181Dh

                        SaveReg <eax,edi>

                        mov     edi,ss:[esp+SIZETHUNKSEF+0Ch]
                        SendAsciiz32    181D            ; DEKKO: Sem Name

                        mov     edi,ss:[esp+SIZETHUNKSEF+10h]
                        mov     eax,ds:[edi]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Sem Handle

                        RestoreReg <edi,eax>
        ras181D:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSPEEKNMPIPE    MACRO                   ; SCI: filesys\nampipe2.asm
                        IFDEF   MMIOPH          ; 6.70  @6.80
                        SetupTest       18h,ras181E,181Eh

                        SendAsDouble    dx              ; DEKKO: Pipe Handle
        ras181E:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSQNMPHANDSTATE MACRO                   ; SCI: filesys\nampipe1.asm
                        IFDEF   MMIOPH          ; 6.70  @6.80
                        SetupTest       18h,ras181F,181Fh

                        SendAsDouble    dx              ; DEKKO: Pipe Handle
        ras181F:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSQNMPIPEINFO   MACRO                   ; SCI: filesys\nampipe1.asm
                        IFDEF   MMIOPH          ; 6.70  @6.80
                        SetupTest       18h,ras1820,1820h

                        SendAsDouble    dx              ; DEKKO: Pipe Handle
        ras1820:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSQNMPIPESEMSTATE MACRO                 ; SCI: filesys\nampipe1.asm
                        IFDEF   MMIOPH          ; 6.70  @6.78
                        SetupTest       18h,ras1821,1821h

                        SendAsDouble    dx,ax           ; DEKKO: Sem Handle

        ras1821:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOS32QUERYEVENTSEM MACRO                 ; SCI: task\semverif.c
                        IFDEF   MMIOPH          ; 6.76  @6.82
                        SetupTest32     18h,ras1823,1823h

                        SaveReg <eax>
                        mov     eax,ss:[esp+SIZETHUNKSEF+08h]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Sem Handle
                        RestoreReg <eax>
        ras1823:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOS32QUERYMUTEXSEM MACRO                 ; SCI: task\semverif.c
                        IFDEF   MMIOPH          ; 6.76  @6.82
                        SetupTest32     18h,ras1824,1824h

                        SaveReg <eax>
                        mov     eax,ss:[esp+SIZETHUNKSEF+08h]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Sem Handle
                        RestoreReg <eax>
        ras1824:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOS32QUERYMUXWAITSEM MACRO               ; SCI: task\semverif.c
                        IFDEF   MMIOPH          ; 6.76  @6.82
                        SetupTest32     18h,ras1825,1825h

                        SaveReg <eax>
                        mov     eax,ss:[esp+SIZETHUNKSEF+08h]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Sem Handle
                        RestoreReg <eax>
        ras1825:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOS32RELEASEMUTEXSEM MACRO               ; SCI: task\semverif.c
                        IFDEF   MMIOPH          ; 6.76  @6.82
                        SetupTest32     18h,ras1827,1827h

                        SaveReg <eax>
                        mov     eax,ss:[esp+24]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Sem Handle
                        RestoreReg <eax>
        ras1827:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOS32REQUESTMUTEXSEM MACRO               ; SCI: task\semverif.c
                        IFDEF   MMIOPH          ; 6.76  @6.82
                        SetupTest32     18h,ras1829,1829h

                        SaveReg <eax>

                        mov     eax,ss:[esp+24]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Sem Handle

                        mov     eax,ss:[esp+28]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Time Out

                        RestoreReg <eax>
        ras1829:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSSETNMPHANDSTATE MACRO                 ; SCI: filesys\nampipe1.asm
                        IFDEF   MMIOPH          ; 6.70  @6.80
                        SetupTest       18h,ras182B,182Bh

                        SendAsDouble    dx              ; DEKKO: Pipe Handle
        ras182B:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSSETNMPIPESEM  MACRO                   ; SCI: filesys\nampipe1.asm
                        IFDEF   MMIOPH          ; 6.70  @6.80
                        SetupTest       18h,ras182C,182Ch

                        SendAsDouble    cx,ax           ; DEKKO: Sem Handle

                        SendAsDouble    dx              ; DEKKO: Pipe Handle
        ras182C:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSTRANSACTNMPIPE MACRO                  ; SCI: filesys\nampipe2.asm
                        IFDEF   MMIOPH          ; 6.70  @6.80
                        SetupTest       18h,ras182D,182Dh

                        SendAsDouble    dx              ; DEKKO: Pipe Handle

                        SendAsDouble    cx              ; DEKKO: In Buffer Len

                        SendAsDouble    ax              ; DEKKO: Out Buffer Len
        ras182D:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOS32WAITEVENTSEM MACRO                  ; SCI: task\semverif.c
                        IFDEF   MMIOPH          ; 6.76  @6.82
                        SetupTest32     18h,ras182E,182Eh

                        SaveReg <eax>

                        mov     eax,ss:[esp+SIZETHUNKSEF+08h]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: SemHandle

                        mov     eax,ss:[esp+SIZETHUNKSEF+0Ch]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: TimeOut

                        RestoreReg <eax>
        ras182E:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOS32WAITMUXWAITSEM MACRO                ; SCI: task\semverif.c
                        IFDEF   MMIOPH          ; 6.76  @6.82
                        SetupTest32     18h,ras182F,182Fh

                        SaveReg <eax>

                        mov     eax,ss:[esp+SIZETHUNKSEF+08h]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: SemHandle

                        mov     eax,ss:[esp+SIZETHUNKSEF+0Ch]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: TimeOut

                        RestoreReg <eax>
        ras182F:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSWAITNMPIPE    MACRO                   ; SCI: filesys\nampipe1.asm
                        IFDEF   MMIOPH          ; 6.70
                        SetupTest       18h,ras1830,1830h

                        SaveReg <ds,di>
                        mov     ds,[bp].sreg_ds         ; get shadow DS
                        mov     di,dx
                        SendAsciiz      1830            ; DEKKO: Pipe Name
                        RestoreReg <di,ds>
        ras1830:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOS32DELETEMUXWAITSEM MACRO              ; SCI: task\semverif.c
                        IFDEF   MMIOPH          ; 6.76  @6.82
                        SetupTest32     18h,ras1833,1833h

                        SaveReg <eax>

                        mov     eax,ss:[esp+SIZETHUNKSEF+08h]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Mux Handle

                        mov     eax,ss:[esp+SIZETHUNKSEF+0Ch]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Sem Handle

                        RestoreReg <eax>
        ras1833:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOS32POSTEVENTSEM MACRO                  ; SCI: task\semverif.c
                        IFDEF   MMIOPH          ; 6.76  @6.82
                        SetupTest32     18h,ras1834,1834h

                        SaveReg <eax>
                        mov     eax,ss:[esp+SIZETHUNKSEF+08h]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Sem Handle
                        RestoreReg <eax>
        ras1834:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSRAWREADNMPIPE MACRO                   ; SCI: filesys\nampipe2.asm
                        IFDEF   MMIOPH          ; 6.70  @6.80
                        SetupTest       18h,ras1835,1835h

                        SendAsDouble    dx              ; DEKKO: Pipe Handle
        ras1835:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSRAWWRITENMPIPE MACRO                  ; SCI: filesys\nampipe2.asm
                        IFDEF   MMIOPH          ; 6.70  @6.80
                        SetupTest       18h,ras1836,1836h

                        SendAsDouble    dx              ; DEKKO: Pipe Handle
        ras1836:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOS32RESETEVENTSEM MACRO                 ; SCI: task\semverif.c
                        IFDEF   MMIOPH          ; 6.76  @6.82
                        SetupTest32     18h,ras1837,1837h

                        SaveReg <eax>
                        mov     eax,ss:[esp+SIZETHUNKSEF+08h]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Sem Handle
                        RestoreReg <eax>
        ras1837:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOS32SETSIGNALEXCEPTIONFOC MACRO         ; SCI: task\sigsubr.c
                        IFDEF   MMIOPH          ; 6.78
                        SetupTest32     18h,ras1839,1839h
        ras1839:
                        ExitMMPH
                        ENDIF
                        ENDM


MMPHPostDOSHOLDSIGNAL   MACRO                   ; SCI: task\sig.asm
                        IFDEF   MMIOPH          ; 6.68  @6.85
                        SetupTest       18h,ras1881,1881h

;;      DOSHoldSignal has two exit points. Thus there are two post-hooks.
;;      The first data field in each hook indicates which of the exits was
;;      taken. MMPHPostDOSHoldSignal2 is the second exit macro.

                        mov     es:[PERF_DATA],0        ; DEKKO: Exit Path

                        SendReturnCode  16              ; DEKKO: Return Code
        ras1881:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSHoldSignal2  MACRO                   ; In-Line: task\sig.asm
                        IFDEF   MMIOPH          ; 6.78  @6.85
                        SetupTest       18h,ras1881a,1881h

                        mov     es:[PERF_DATA],1        ; DEKKO: Exit Path

                        mov     es:[PERF_DATA],ax       ; DEKKO: Return Code
        ras1881a:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSSENDSIGNAL   MACRO                   ; SCI: task\sig.asm
                        IFDEF   MMIOPH          ; 6.68
                        SetupTest       18h,ras1882,1882h
        ras1882:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSSETSIGHANDLER MACRO                  ; SCI: task\sig.asm
                        IFDEF   MMIOPH          ; 6.68
                        SetupTest       18h,ras1883,1883h
        ras1883:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSMAKEPIPE     MACRO                   ; SCI: filesys\pipe.asm
                        IFDEF   MMIOPH          ; 6.68  @6.80
                        SetupTest       18h,ras1884,1884h

                        SendAsDouble    ax              ; DEKKO: Read Handle

                        SendAsDouble    bx              ; DEKKO: Write Handle
        ras1884:
                        ExitMMPH
                        ENDIF
                        ENDM

;; 1885 - PostDOSSemClear ............. see \drv6\src\doscall1\dc1mmpha.inc

;; 1886 - PostDOSSemRequest ........... see \drv6\src\doscall1\dc1mmpha.inc

;; 1887 - PostDOSSemSet ............... see \drv6\src\doscall1\dc1mmpha.inc

MMPHPostDOSSEMSETWAIT   MACRO                   ; SCI: task\sem.asm
                        IFDEF   MMIOPH          ; 6.68
                        SetupTest       18h,ras1888,1888h
        ras1888:
                        ExitMMPH
                        ENDIF
                        ENDM

;; 1889 - PostDOSSemWait .............. see \drv6\src\doscall1\dc1mmpha.inc

MMPHPostDOSMUXSEMWAIT   MACRO                   ; SCI: task\muxsem.asm
                        IFDEF   MMIOPH          ; 6.68
                        SetupTest       18h,ras188A1,188Ah

                        SendReturnCode  16              ; DEKKO: Semaphore Index
        ras188A1:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSMuxSemWait2  MACRO                   ; SCI: task\muxsem.asm
                        IFDEF   MMIOPH          ; 6.68
                        SetupTest       18h,ras188A2,188Ah

                        mov     es:[PERF_DATA],ax       ; DEKKO: Semaphore Index
        ras188A2:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSCLOSESEM     MACRO                   ; SCI: task\syssem.asm
                        IFDEF   MMIOPH          ; 6.68
                        SetupTest       18h,ras188B,188Bh
        ras188B:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSCREATESEM    MACRO                   ; SCI: task\syssem.asm
                        IFDEF   MMIOPH          ; 6.70  @6.78
                        SetupTest       18h,ras188C,188Ch

                        SendAsDouble    ax,dx           ; DEKKO: Sem Handle
        ras188C:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSOPENSEM      MACRO                   ; SCI: task\syssem.asm
                        IFDEF   MMIOPH          ; 6.70  @6.78
                        SetupTest       18h,ras188D,188Dh

                        SendAsDouble    ax,dx           ; DEKKO: Sem Handle
        ras188D:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOS32ADDMUXWAITSEM MACRO                ; SCI: task\semverif.c
                        IFDEF   MMIOPH          ; 6.76  @6.82
                        SetupTest32     18h,ras188F,188Fh

                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Return Code
        ras188F:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSCALLNMPIPE   MACRO                   ; SCI: filesys\nampipe1.asm
                        IFDEF   MMIOPH          ; 6.76
                        SetupTest       18h,ras1890,1890h

                        SendReturnCode  32              ; DEKKO: BytesOut
        ras1890:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOS32CLOSEEVENTSEM MACRO                ; SCI: task\semverif.c
                        IFDEF   MMIOPH          ; 6.76  @6.82
                        SetupTest32     18h,ras1892,1892h

                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Return Code
        ras1892:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOS32CLOSEMUTEXSEM MACRO                ; SCI: task\semverif.c
                        IFDEF   MMIOPH          ; 6.76  @6.82
                        SetupTest32     18h,ras1893,1893h

                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Return Code
        ras1893:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOS32CLOSEMUXWAITSEM MACRO              ; SCI: task\semverif.c
                        IFDEF   MMIOPH          ; 6.76  @6.82
                        SetupTest32     18h,ras1894,1894h

                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Return Code
        ras1894:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSCONNECTNMPIPE MACRO                  ; SCI: filesys\nampipe1.asm
                        IFDEF   MMIOPH          ; 6.70
                        SetupTest       18h,ras1895,1895h

                        SendReturnCode  32              ; DEKKO: Return Code
        ras1895:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOS32CREATEEVENTSEM MACRO               ; SCI: task\semverif.c
                        IFDEF   MMIOPH          ; 6.76  @6.82
                        SetupTest32     18h,ras1896,1896h

                        SaveReg <eax,edi>
                        mov     edi,ss:[esp+SIZETHUNKSEF+10h]
                        mov     eax,ds:[edi]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Sem Handle
                        RestoreReg <edi,eax>

                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Return Code
        ras1896:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOS32CREATEMUTEXSEM MACRO               ; SCI: task\semverif.c
                        IFDEF   MMIOPH          ; 6.76  @6.82
                        SetupTest32     18h,ras1897,1897h

                        SaveReg <eax,edi>
                        mov     edi,ss:[esp+SIZETHUNKSEF+10h]
                        mov     eax,ds:[edi]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Sem Handle
                        RestoreReg <edi,eax>

                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Return Code
        ras1897:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOS32CREATEMUXWAITSEM MACRO             ; SCI: task\semverif.c
                        IFDEF   MMIOPH          ; 6.76  @6.82
                        SetupTest32     18h,ras1898,1898h

                        SaveReg <eax,edi>
                        mov     edi,ss:[esp+SIZETHUNKSEF+10h]
                        mov     eax,ds:[edi]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Sem Handle
                        RestoreReg <edi,eax>

                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Return Code
        ras1898:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSDISCONNECTNMPIPE MACRO               ; SCI: filesys\nampipe1.asm
                        IFDEF   MMIOPH          ; 6.70
                        SetupTest       18h,ras1899,1899h

                        SendReturnCode  32              ; DEKKO: Return Code
        ras1899:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSMAKENMPIPE   MACRO                   ; SCI: filesys\nampipe1.asm
                        IFDEF   MMIOPH          ; 6.70  @6.80
                        SetupTest       18h,ras189A,189Ah

                        SendAsDouble    ax              ; DEKKO: Pipe Handle
        ras189A:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOS32OPENEVENTSEM MACRO                 ; SCI: task\semverif.c
                        IFDEF   MMIOPH          ; 6.76  @6.82
                        SetupTest32     18h,ras189B,189Bh

                        SaveReg <eax,edi>
                        mov     edi,ss:[esp+SIZETHUNKSEF+10h]
                        mov     eax,ds:[edi]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: SemHandle
                        RestoreReg <edi,eax>

                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Return Code
        ras189B:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOS32OPENMUTEXSEM MACRO                 ; SCI: task\semverif.c
                        IFDEF   MMIOPH          ; 6.76  @6.82
                        SetupTest32     18h,ras189C,189Ch

                        SaveReg <eax,edi>
                        mov     edi,ss:[esp+SIZETHUNKSEF+10h]
                        mov     eax,ds:[edi]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Sem Handle
                        RestoreReg <edi,eax>

                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Return Code
        ras189C:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOS32OPENMUXWAITSEM MACRO               ; SCI: task\semverif.c
                        IFDEF   MMIOPH          ; 6.76  @6.82
                        SetupTest32     18h,ras189D,189Dh

                        SaveReg <eax,edi>
                        mov     edi,ss:[esp+SIZETHUNKSEF+10h]
                        mov     eax,ds:[edi]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Sem Handle
                        RestoreReg <edi,eax>

                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Return Code
        ras189D:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSPEEKNMPIPE   MACRO                   ; SCI: filesys\nampipe2.asm
                        IFDEF   MMIOPH          ; 6.70  @6.80
                        SetupTest       18h,ras189E,189Eh

                        SendAsDouble    ax              ; DEKKO: Bytes Read
        ras189E:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSQNMPHANDSTATE MACRO                  ; SCI: filesys\nampipe1.asm
                        IFDEF   MMIOPH          ; 6.70
                        SetupTest       18h,ras189F,189Fh

                        SendAsDouble    ax              ; DEKKO: PipeHandleState

                        SendReturnCode  32              ; DEKKO: Return Code
        ras189F:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSQNMPIPEINFO  MACRO                   ; SCI: filesys\nampipe1.asm
                        IFDEF   MMIOPH          ; 6.70
                        SetupTest       18h,ras18A0,18A0h

                        SendReturnCode  32              ; DEKKO: Return Code
        ras18A0:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSQNMPIPESEMSTATE MACRO                ; SCI: filesys\nampipe1.asm
                        IFDEF   MMIOPH          ; 6.70
                        SetupTest       18h,ras18A1,18A1h

                        SendReturnCode  32              ; DEKKO: Return Code
        ras18A1:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOS32QUERYEVENTSEM MACRO                ; SCI: task\semverif.c
                        IFDEF   MMIOPH          ; 6.76  @6.82
                        SetupTest32     18h,ras18A3,18A3h

                        SaveReg <eax,edi>
                        mov     edi,ss:[esp+SIZETHUNKSEF+10h]
                        mov     eax,ds:[edi]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Number Of Posts
                        RestoreReg <edi,eax>

                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Return Code
        ras18A3:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOS32QUERYMUTEXSEM MACRO                ; SCI: task\semverif.c
                        IFDEF   MMIOPH          ; 6.76  @6.82
                        SetupTest32     18h,ras18A4,18A4h

                        SaveReg <eax,edi>

                        mov     edi,ss:[esp+SIZETHUNKSEF+10h]
                        mov     eax,ds:[edi]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Process ID

                        mov     edi,ss:[esp+SIZETHUNKSEF+14h]
                        mov     eax,ds:[edi]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Thread ID

                        mov     edi,ss:[esp+SIZETHUNKSEF+18h]
                        mov     eax,ds:[edi]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Count

                        RestoreReg <edi,eax>

                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Return Code
        ras18A4:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOS32QUERYMUXWAITSEM MACRO              ; SCI: task\semverif.c
                        IFDEF   MMIOPH          ; 6.76  @6.82
                        SetupTest32     18h,ras18A5,18A5h

                        SaveReg <eax,edi>

                        mov     edi,ss:[esp+SIZETHUNKSEF+10h]
                        mov     eax,ds:[edi]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: SemRec Entries

                        mov     edi,ss:[esp+SIZETHUNKSEF+14h]
                        mov     eax,ds:[edi]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Sem Rec Ptr

                        mov     edi,ss:[esp+SIZETHUNKSEF+18h]
                        mov     eax,ds:[edi]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Attributes

                        RestoreReg <edi,eax>

                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Return Code
        ras18A5:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOS32RELEASEMUTEXSEM MACRO              ; SCI: task\semverif.c
                        IFDEF   MMIOPH          ; 6.76  @6.82
                        SetupTest32     18h,ras18A7,18A7h

                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Return Code
        ras18A7:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOS32REQUESTMUTEXSEM MACRO              ; SCI: task\semverif.c
                        IFDEF   MMIOPH          ; 6.76  @6.82
                        SetupTest32     18h,ras18A9,18A9h

                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Return Code
        ras18A9:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSSETNMPHANDSTATE MACRO                ; SCI: filesys\nampipe1.asm
                        IFDEF   MMIOPH          ; 6.70
                        SetupTest       18h,ras18AB,18ABh

                        SendReturnCode  32              ; DEKKO: Return Code
        ras18AB:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSSETNMPIPESEM MACRO                   ; SCI: filesys\nampipe1.asm
                        IFDEF   MMIOPH          ; 6.70
                        SetupTest       18h,ras18AC,18ACh

                        SendReturnCode  32              ; DEKKO: Return Code
        ras18AC:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSTRANSACTNMPIPE MACRO                 ; SCI: filesys\nampipe2.asm
                        IFDEF   MMIOPH          ; 6.70  @6.80
                        SetupTest       18h,ras18AD,18ADh

                        SendAsDouble    cx              ; DEKKO: Bytes Out
        ras18AD:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOS32WAITEVENTSEM MACRO                 ; SCI: task\semverif.c
                        IFDEF   MMIOPH          ; 6.76  @6.82
                        SetupTest32     18h,ras18AE,18AEh

                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Return Code
        ras18AE:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOS32WAITMUXWAITSEM MACRO               ; SCI: task\semverif.c
                        IFDEF   MMIOPH          ; 6.76  @6.82
                        SetupTest32     18h,ras18AF,18AFh

                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Return Code
        ras18AF:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSWAITNMPIPE   MACRO                   ; SCI: filesys\nampipe1.asm
                        IFDEF   MMIOPH          ; 6.70
                        SetupTest       18h,ras18B0,18B0h

                        SendReturnCode  32              ; DEKKO: Return Code
        ras18B0:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOS32DELETEMUXWAITSEM MACRO             ; SCI: task\semverif.c
                        IFDEF   MMIOPH          ; 6.76  @6.82
                        SetupTest32     18h,ras18B3,18B3h

                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Return Code
        ras18B3:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOS32POSTEVENTSEM MACRO                 ; SCI: task\semverif.c
                        IFDEF   MMIOPH          ; 6.76  @6.82
                        SetupTest32     18h,ras18B4,18B4h

                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Return Code
        ras18B4:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSRAWREADNMPIPE MACRO                  ; SCI: filesys\nampipe2.asm
                        IFDEF   MMIOPH          ; 6.70
                        SetupTest       18h,ras18B5,18B5h

                        SendAsDouble    cx              ; DEKKO: Numb Bytes Read

                        SendReturnCode  32              ; DEKKO: Return Code
        ras18B5:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSRAWWRITENMPIPE MACRO                 ; SCI: filesys\nampipe2.asm
                        IFDEF   MMIOPH          ; 6.70
                        SetupTest       18h,ras18B6,18B6h

                        SendAsDouble    cx      ; DEKKO: Numb Bytes written

                        SendReturnCode  32      ; DEKKO: Return Code
        ras18B6:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOS32RESETEVENTSEM MACRO                ; SCI: task\semverif.c
                        IFDEF   MMIOPH          ; 6.76  @6.82
                        SetupTest32     18h,ras18B7,18B7h

                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Return Code
        ras18B7:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOS32SETSIGNALEXCEPTIONFOC MACRO        ; SCI: task\sigsubr.c
                        IFDEF   MMIOPH          ; 6.78
                        SetupTest32     18h,ras18B9,18B9h
        ras18B9:
                        ExitMMPH
                        ENDIF
                        ENDM


;****************************************************************************
;
;       MISCELLANEOUS SERVICES: External Interface  -  Major Code 1Ch
;
;****************************************************************************

MMPHPreDOSERROR         MACRO                   ; SCI: filesys\getset2.asm
                        IFDEF   MMIOPH          ; 6.72
                        SetupTest       1Ch,ras1C01,1C01h
        ras1C01:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSSETVEC        MACRO                   ; SCI: task\trap286.asm
                        IFDEF   MMIOPH          ; 6.72
                        SetupTest       1Ch,ras1C02,1C02h
        ras1C02:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSSYSTRACE      MACRO                   ; SCI: task\rasstrp.asm
                        IFDEF   MMIOPH          ; 6.72
                        SetupTest       1Ch,ras1C05,1C05h
        ras1C05:
                        ExitMMPH
                        ENDIF
                        ENDM

;; 1C06 - PreDOSErrClass .............. see \drv6\src\doscall1\dc1mmpha.inc

;; 1C07 - PreDOSLogRead ............... see \drv6\src\doscall1\dc1mmph.h

;; 1C08 - PreDOSLogRegister ........... see \drv6\src\doscall1\dc1mmph.h

;; 1C09 - PreDOSDynamicTrace .......... see \drv6\h\mmph.h

;; 1C0A - PreDOSRaiseException ........ see \drv6\src\doscall1\dc1mmph.h

;; 1C0B - PreDOSSetExceptHandler ...... see \drv6\src\doscall1\dc1mmph.h

;; 1C0C - PreDOSUnsetExceptHandler .... see \drv6\src\doscall1\dc1mmph.h

;; 1C0D - PerDOSUnwindExceptHandler ... see \drv6\src\doscall1\dc1mmph.h

MMPHPreDOSSETTRACEINFO  MACRO                   ; SCI: task\rasstru.asm
                        IFDEF   MMIOPH          ; 6.72
                        SetupTest       1Ch,ras1C0E,1C0Eh

                        mov     es:[PERF_DATA],bx       ; DEKKO: Request Code

                        mov     es:[PERF_DATA],cx       ; DEKKO: Process Id

                        mov     es:[PERF_DATA],dx       ; DEKKO: Count
        ras1C0E:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSSYSTEMSERVICE MACRO                   ; SCI: task\sysserv.asm
                        IFDEF   MMIOPH          ; 6.72
                        SetupTest       1Ch,ras1C0F,1C0Fh

                        push    di
                        if ?sci_sreg_di eq ?SCI_IN_USE     ; if DI is shadowed,
                           mov     di,[bp].sreg_di         ;   load it
                        endif
                        mov     es:[PERF_DATA],di       ; DEKKO: Function
                        pop     di
        ras1C0F:
                        ExitMMPH
                        ENDIF
                        ENDM


MMPHPostDOSERROR        MACRO                   ; SCI: dos\filesys\getset2.asm
                        IFDEF   MMIOPH          ; 6.72
                        SetupTest       1Ch,ras1C81,1C81h
        ras1C81:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSSETVEC       MACRO                   ; SCI: task\trap286.asm
                        IFDEF   MMIOPH          ; 6.72
                        SetupTest       1Ch,ras1C82,1C82h
        ras1C82:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSSYSTRACE     MACRO                   ; SCI: task\rasstrp.asm
                        IFDEF   MMIOPH          ; 6.72
                        SetupTest       1Ch,ras1C85,1C85h
        ras1C85:
                        ExitMMPH
                        ENDIF
                        ENDM

;; 1C86 - PostDOSErrClass ............. see \drv6\src\doscall1\dc1mmpha.inc

;; 1C87 - PostDOSLogRead .............. see \drv6\src\doscall1\dc1mmph.h

;; 1C88 - PostDOSLogRegister .......... see \drv6\src\doscall1\dc1mmph.h

;; 1C89 - PostDOSDynamicTrace ......... see \drv6\h\mmph.h

;; 1C8A - PostDOSRaiseException ....... see \drv6\src\doscall1\dc1mmph.h

;; 1C8B - PostDOSSetExceptHandler ..... see \drv6\src\doscall1\dc1mmph.h

;; 1C8C - PostDOSUnsetExceptHandler ... see \drv6\src\doscall1\dc1mmph.h

;; 1C8D - PostDOSUnwindExceptHandler .. see \drv6\src\doscall1\dc1mmph.h

MMPHPostDOSSETTRACEINFO MACRO                   ; SCI: task\rasstru.asm
                        IFDEF   MMIOPH          ; 6.72
                        SetupTest       1Ch,ras1C8E,1C8Eh

                        SendReturnCode  16              ; DEKKO: Return Code
        ras1C8E:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSSYSTEMSERVICE MACRO                  ; SCI: task\sysserv.asm
                        IFDEF   MMIOPH          ; 6.72
                        SetupTest       1Ch,ras1C8F,1C8Fh

                        SendReturnCode  16              ; DEKKO: Return Code
        ras1C8F:
                        ExitMMPH
                        ENDIF
                        ENDM


;****************************************************************************
;
;       PHYSICAL MEMORY MGNT - Internal Interface  -  Major Code 20h
;
;        All hooks are located in \drv6\h\mmph.h
;
;****************************************************************************


;****************************************************************************
;
;       VIRTUAL MEMORY MGNT: External Interface  -  Major Code 24h
;
;****************************************************************************

MMPHPreDOSALLOCSEG      MACRO                   ; SCI: memory\selwrk.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest       24h,ras2401,2401h

                        mov     es:[PERF_DATA],bx       ; DEKKO: Mem Obj Size
        ras2401:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSALLOCSHRSEG   MACRO                   ; SCI: memory\vmname.asm
                        IFDEF   MMIOPH          ; 6.66
                        SetupTest       24h,ras2402,2402h

                        SaveReg <ds,di>
                        mov     ds,[bp].sreg_ds         ; get shadow DS
                        mov     di,dx                   ;    DS:DI => SegName
                        SendAsciiz      2402            ; DEKKO: Shrd Seg Name

                        mov     es:[PERF_DATA],bx       ; DEKKO: Mem Obj Size
                        RestoreReg <di,ds>
        ras2402:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSGETSHRSEG     MACRO                   ; SCI: memory\vmname.asm
                        IFDEF   MMIOPH          ; 6.66
                        SetupTest       24h,ras2403,2403h

                        SaveReg <ds,di>
                        mov     ds,[bp].sreg_ds         ; get shadow DS
                        mov     di,dx                   ;    DS:DI => SegName
                        SendAsciiz      2403            ; DEKKO: Shared Seg Name
                        RestoreReg <di,ds>
        ras2403:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSREALLOCSEG    MACRO                   ; SCI: memory\selwrk.asm
                        IFDEF   MMIOPH          ; 6.66
                        SetupTest       24h,ras2404,2404h

                        mov     es:[PERF_DATA],ax       ; DEKKO: Selector

                        mov     es:[PERF_DATA],bx       ; DEKKO: Size
        ras2404:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSFREESEG       MACRO                   ; SCI: memory\selwrk.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest       24h,ras2405,2405h

                        mov     es:[PERF_DATA],ax       ; DEKKO: SELECTOR
        ras2405:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSALLOCHUGE     MACRO                   ; SCI: memory\selwrk.asm
                        IFDEF   MMIOPH          ; 6.62  @6.78
                        SetupTest       24h,ras2406,2406h

                        SendAsDouble    bx,ax           ; DEKKO: Initial Size

                        mov     es:[PERF_DATA],cx       ; DEKKO: Max Size
        ras2406:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSREALLOCHUGE   MACRO                   ; SCI: memory\selwrk.asm
                        IFDEF   MMIOPH          ; 6.66  @6.78
                        SetupTest       24h,ras2407,2407h

                        SendAsDouble    bx,ax           ; DEKKO: Initial Size

                        mov     es:[PERF_DATA],cx       ; DEKKO: Selector
        ras2407:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSCREATECSALIAS MACRO                   ; SCI: memory\selwrk.asm
                        IFDEF   MMIOPH          ; 6.66
                        SetupTest       24h,ras2408,2408h
        ras2408:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSGIVESEG       MACRO                   ; SCI: memory\selwrk.asm
                        IFDEF   MMIOPH          ; 6.66
                        SetupTest       24h,ras2409,2409h

                        mov     es:[PERF_DATA],ax       ; DEKKO: SELECTOR

                        mov     es:[PERF_DATA],bx       ; DEKKO: Process Id
        ras2409:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOS32ALLOCMEM    MACRO                   ; SCI: memory\vmapi.c
                        IFDEF   MMIOPH          ; 6.68  @6.76
                        SetupTest32     24h,ras240A,240Ah

                        SaveReg <eax>

                        mov     eax,ss:[esp+SIZETHUNKSEF+0Ch]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: MemObjSize

                        mov     eax,ss:[esp+SIZETHUNKSEF+10h]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Flags

                        RestoreReg <eax>
        ras240A:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOS32ALLOCSHAREDMEM MACRO                ; SCI: memory\vmapi.c
                        IFDEF   MMIOPH          ; 6.68  @6.76
                        SetupTest32     24h,ras240B,240Bh

                        SaveReg <eax>
                        mov     edi,ss:[esp+SIZETHUNKSEF+0Ch]
                        SendAsciiz32    240B            ; DEKKO: Proc Name

                        mov     eax,ss:[esp+SIZETHUNKSEF+10h]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: MemObjSize

                        mov     eax,ss:[esp+SIZETHUNKSEF+14h]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Flags

                        RestoreReg <eax>
        ras240B:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOS32FREEMEM     MACRO                   ; SCI: memory\vmapi.c
                        IFDEF   MMIOPH          ; 6.68  @6.76
                        SetupTest32     24h,ras240C,240Ch

                        SaveReg <eax>
                        mov     eax,ss:[esp+SIZETHUNKSEF+08h]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Base Address
                        RestoreReg <eax>
        ras240C:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSGetHugeShift  MACRO                   ; In-Line: memory\selwrk.asm
                        IFDEF   MMIOPH          ; 6.68  @6.90
                        SetupTest       24h,ras240D,240Dh
        ras240D:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOS32GETNAMEDSHAREDMEM MACRO             ; SCI: memory\vmapi.c
                        IFDEF   MMIOPH          ; 6.68  @6.82
                        SetupTest32     24h,ras240E,240Eh

                        SaveReg <edi,eax>

                        mov     edi,ss:[esp+SIZETHUNKSEF+10h]
                        SendAsciiz32    240E            ; DEKKO: SharedMemName

                        mov     eax,ss:[esp+SIZETHUNKSEF+14h]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Flags

                        RestoreReg <eax,edi>
        ras240E:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOS32GETRESOURCE MACRO                   ; SCI: memory\ldrsubr.c
                        IFDEF   MMIOPH          ; 6.68  @6.76
                        SetupTest32     24h,ras240F,240Fh

                        SaveReg <eax>

                        mov     ax,ss:[esp+SIZETHUNKSEF+08h]          ; AA03901
                        SendAsDouble    ax              ; DEKKO: Module Handle

                        mov     eax,ss:[esp+SIZETHUNKSEF+10h]         ; AA03901
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Type Id

                        mov     eax,ss:[esp+SIZETHUNKSEF+0ch]         ; AA03901
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Name Id

                        RestoreReg <eax>
        ras240F:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOS32GETSHAREDMEM  MACRO                 ; SCI: memory\vmapi.c
                        IFDEF   MMIOPH          ; 6.68  @6.76
                        SetupTest32     24h,ras2410,2410h

                        SaveReg <eax>

                        mov     eax,ss:[esp+SIZETHUNKSEF+08h]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Base Address

                        mov     eax,ss:[esp+SIZETHUNKSEF+0Ch]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Flags

                        RestoreReg <eax>
        ras2410:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSGETSEG        MACRO                   ; SCI: memory\selwrk.asm
                        IFDEF   MMIOPH          ; 6.66
                        SetupTest       24h,ras2411,2411h

                        mov     es:[PERF_DATA],ax       ; DEKKO: Selector
        ras2411:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOS32GIVESHAREDMEM MACRO                 ; SCI: memory\vmapi.c
                        IFDEF   MMIOPH          ; 6.68  @6.76
                        SetupTest32     24h,ras2412,2412h

                        SaveReg <eax>

                        mov     eax,ss:[esp+SIZETHUNKSEF+08h]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Base Address

                        mov     eax,ss:[esp+SIZETHUNKSEF+0Ch]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Process Id

                        mov     eax,ss:[esp+SIZETHUNKSEF+10h]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Flags

                        RestoreReg <eax>
        ras2412:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSLockSeg       MACRO                   ; In-Line: memory\selwrk.asm
                        IFDEF   MMIOPH          ; 6.68  @6.90
                        SetupTest       24h,ras2413,2413h
        ras2413:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSMemAvail      MACRO                   ; In-Line: memory\selwrk.asm
                        IFDEF   MMIOPH          ; 6.68  @6.90
                        SetupTest       24h,ras2416,2416h
        ras2416:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOS32QUERYMEM    MACRO                   ; SCI: memory\vmapi.c
                        IFDEF   MMIOPH          ; 6.68  @6.80
                        SetupTest32     24h,ras2417,2417h

                        SaveReg <eax,edi>

                        mov     eax,ss:[esp+SIZETHUNKSEF+0Ch]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Base Address

                        mov     edi,ss:[esp+SIZETHUNKSEF+10h]
                        mov     eax,ds:[edi]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Size

                        RestoreReg <edi,eax>
        ras2417:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOS32SETMEM      MACRO                   ; SCI: memory\vmapi.c
                        IFDEF   MMIOPH          ; 6.68  @6.76
                        SetupTest32     24h,ras2418,2418h

                        SaveReg <eax>

                        mov     eax,ss:[esp+SIZETHUNKSEF+08h]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Base Address

                        mov     eax,ss:[esp+SIZETHUNKSEF+0Ch]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Region Sizes

                        mov     eax,ss:[esp+SIZETHUNKSEF+10h]
                        mov     es:[PERF_DATA_4],eax      ; DEKKO: Flags

                        RestoreReg <eax>
        ras2418:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSSizeSeg       MACRO                   ; In-Line: memory\selwrk.asm
                        IFDEF   MMIOPH          ; 6.68  @6.90
                        SetupTest       24h,ras2419,2419h
        ras2419:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSUnLockSeg     MACRO                   ; In-Line: memory\selwrk.asm
                        IFDEF   MMIOPH          ; 6.68  @6.90
                        SetupTest       24h,ras241A,241Ah
        ras241A:
                        ExitMMPH
                        ENDIF
                        ENDM

;; 241B - PreDOSSubAlloc .............. see \drv6\src\doscall1\dc1mmpha.inc

;; 241C - PreDOS32SubAlloc ............ see \drv6\src\doscall1\dc1mmph.h

;; 241D - PreDOSSubFree ............... see \drv6\scr\doscall1\dc1mmpha.inc

;; 241E - PreDOS32SubFree ............. see \drv6\scr\doscall1\dc1mmph.h

;; 241F - PreDOSSubSet ................ see \drv6\src\doscall1\dc1mmpha.inc

;; 2420 - PreDOS32SubSet .............. see \drv6\scr\doscall1\dc1mmph.h

MMPHPreDOS32ALIASMEM    MACRO                   ; SCI: memory\vmapi.c
                        IFDEF   MMIOPH          ; 6.68  @6.76
                        SetupTest32     24h,ras2421,2421h

                        SaveReg <eax>

                        mov     eax,ss:[esp+SIZETHUNKSEF+08h]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Address

                        mov     eax,ss:[esp+SIZETHUNKSEF+0Ch]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Size

                        RestoreReg <eax>
        ras2421:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOS32ALLOCPROTECTEDMEM MACRO             ; SCI: memory\vmapi.c
                        IFDEF   MMIOPH          ; 6.68  @6.76
                        SetupTest32     24h,ras2422,2422h

                        SaveReg <eax>

                        mov     eax,ss:[esp+SIZETHUNKSEF+10h]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Size

                        mov     eax,ss:[esp+SIZETHUNKSEF+14h]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Flags

                        RestoreReg <eax>
        ras2422:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSALLOCPROTHUGE MACRO                   ; SCI: memory\selwrk.asm
                        IFDEF   MMIOPH          ; 6.68
                        SetupTest       24h,ras2423,2423h

                        SendAsDouble    bx,ax           ; DEKKO: Initial Size

                        mov     es:[PERF_DATA],cx       ; DEKKO: Max Size
        ras2423:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSALLOCPROTSEG  MACRO                   ; SCI: memory\selwrk.asm
                        IFDEF   MMIOPH          ; 6.68
                        SetupTest       24h,ras2424,2424h

                        mov     es:[PERF_DATA],ax       ; DEKKO: Flags

                        mov     es:[PERF_DATA],bx       ; DEKKO: Size
        ras2424:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSALLOCSHRPROTSEG MACRO                 ; SCI: memory\vmname.asm
                        IFDEF   MMIOPH          ; 6.68
                        SetupTest       24h,ras2425,2425h

                        SaveReg <ds,di>
                        mov     ds,[bp].sreg_ds         ;    get shadow DS
                        mov     di,dx                   ;    ds:di => seg name
                        SendAsciiz      2425            ; DEKKO: Shrd Seg Name

                        mov     es:[PERF_DATA],bx       ; DEKKO: Seg Size
                        RestoreReg <di,ds>
        ras2425:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOS32QUERYMEMSTATE MACRO                 ; SCI: memory\vmapi.c
                        IFDEF   MMIOPH          ; 6.68  @6.82
                        SetupTest32     24h,ras2426,2426h

                        SaveReg <eax,edi>

                        mov     eax,ss:[esp+SIZETHUNKSEF+0Ch]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Base Address

                        mov     edi,ss:[esp+SIZETHUNKSEF+10h]
                        mov     eax,ds:[edi]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Size

                        RestoreReg <edi,eax>
        ras2426:
                        ExitMMPH
                        ENDIF
                        ENDM

;; 2427 - PreDOSSubUnSet .............. see \drv6\src\doscall1\dc1mmph.h


MMPHPostDOSALLOCSEG     MACRO                   ; SCI: memory\selwrk.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest       24h,ras2481,2481h

                        mov     es:[PERF_DATA],ax       ; DEKKO: Selector
        ras2481:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSALLOCSHRSEG  MACRO                   ; SCI: memory\vmname.asm
                        IFDEF   MMIOPH          ; 6.66
                        SetupTest       24h,ras2482,2482h

                        mov     es:[PERF_DATA],ax       ; DEKKO: Selector
        ras2482:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSGETSHRSEG    MACRO                   ; SCI: memory\vmname.asm
                        IFDEF   MMIOPH          ; 6.66
                        SetupTest       24h,ras2483,2483h

                        mov     es:[PERF_DATA],ax       ; DEKKO: Selector
        ras2483:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSREALLOCSEG   MACRO                   ; SCI: memory\selwrk.asm
                        IFDEF   MMIOPH          ; 6.66
                        SetupTest       24h,ras2484,2484h

                        SendReturnCode  16              ; DEKKO: Return Code
        ras2484:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSFREESEG      MACRO                   ; SCI: memory\selwrk.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest       24h,ras2485,2485h
        ras2485:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSALLOCHUGE    MACRO                   ; SCI: memory\selwrk.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest       24h,ras2486,2486h

                        mov     es:[PERF_DATA],ax       ; DEKKO: Base Selector
        ras2486:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSREALLOCHUGE  MACRO                   ; SCI: memory\selwrk.asm
                        IFDEF   MMIOPH          ; 6.66
                        SetupTest       24h,ras2487,2487h

                        SendReturnCode  16              ; DEKKO: Return Code
        ras2487:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSCREATECSALIAS MACRO                  ; SCI: memory\selwrk.asm
                        IFDEF   MMIOPH          ; 6.66
                        SetupTest       24h,ras2488,2488h
        ras2488:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSGIVESEG      MACRO                   ; SCI: memory\selwrk.asm
                        IFDEF   MMIOPH          ; 6.66
                        SetupTest       24h,ras2489,2489h

                        mov     es:[PERF_DATA],ax       ; DEKKO: Selector

                        push    di
                        if ?sci_sreg_di eq ?SCI_IN_USE     ; if DI is shadowed,
                           mov     di,[bp].sreg_di         ;   load it
                        endif
                        mov     es:[PERF_DATA],di       ; DEKKO: Return Code
                        pop     di
        ras2489:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOS32ALLOCMEM   MACRO                   ; SCI: memory\vmapi.c
                        IFDEF   MMIOPH          ; 6.68  @6.82
                        SetupTest32     24h,ras248A,248Ah

                        SaveReg <edi,eax>
                        mov     edi,ss:[esp+SIZETHUNKSEF+0Ch]
                        mov     eax,ds:[edi]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Base Address
                        RestoreReg <eax,edi>

                        SendAsDouble    ax              ; DEKKO: Return Code
        ras248A:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOS32ALLOCSHAREDMEM MACRO               ; SCI: memory\vmapi.c
                        IFDEF   MMIOPH          ; 6.68  @6.82
                        SetupTest32     24h,ras248B,248Bh

                        SaveReg <edi,eax>
                        mov     edi,ss:[esp+SIZETHUNKSEF+0Ch]
                        mov     eax,ds:[edi]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Base Address
                        RestoreReg <eax,edi>

                        SendAsDouble    ax              ; DEKKO: Return Code
        ras248B:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOS32FREEMEM    MACRO                   ; SCI: memory\vmapi.c
                        IFDEF   MMIOPH          ; 6.68  @6.76
                        SetupTest32     24h,ras248C,248Ch

                        SendAsDouble    ax              ; DEKKO: Return Code
        ras248C:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSGetHugeShift MACRO                   ; In-Line: memory\selwrk.asm
                        IFDEF   MMIOPH          ; 6.68  @6.90
                        SetupTest       24h,ras248D,248Dh
        ras248D:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOS32GETNAMEDSHAREDMEM MACRO            ; SCI: memory\vmapi.c
                        IFDEF   MMIOPH          ; 6.68  @6.82
                        SetupTest32     24h,ras248E,248Eh

                        SaveReg <edi,eax>
                        mov     edi,ss:[esp+SIZETHUNKSEF+0Ch]
                        mov     eax,ds:[edi]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Base Address
                        RestoreReg <eax,edi>

                        SendAsDouble    ax              ; DEKKO: Return Code
        ras248E:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOS32GETRESOURCE MACRO                  ; SCI: memory\ldrsubr.c
                        IFDEF   MMIOPH          ; 6.68  @6.82
                        SetupTest32     24h,ras248F,248Fh

                        SaveReg <edi,eax>
                        mov     edi,ss:[esp+SIZETHUNKSEF+18h]  ; PTR: AA03788
                        mov     eax,ds:[edi]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Base Address
                        RestoreReg <eax,edi>

                        SendAsDouble    ax              ; DEKKO: Return Code
        ras248F:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOS32GETSHAREDMEM MACRO                 ; SCI: memory\vmapi.c
                        IFDEF   MMIOPH          ; 6.68
                        SetupTest32     24h,ras2490,2490h

                        SendAsDouble    ax              ; DEKKO: Return Code
        ras2490:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSGETSEG       MACRO                   ; SCI: memory\selwrk.asm
                        IFDEF   MMIOPH          ; 6.66
                        SetupTest       24h,ras2491,2491h

                        SendReturnCode  16              ; DEKKO: Return Code
        ras2491:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOS32GIVESHAREDMEM MACRO                ; SCI: memory\vmapi.c
                        IFDEF   MMIOPH          ; 6.68  @6.80
                        SetupTest32     24h,ras2492,2492h

                        SendAsDouble    ax              ; DEKKO: Return Code
        ras2492:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSLockSeg      MACRO                   ; In-Line: memory\selwrk.asm
                        IFDEF   MMIOPH
                        SetupTest       24h,ras2493,2493h
        ras2493:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSMemAvail     MACRO                   ; SCI: memory\selwrk.asm
                        IFDEF   MMIOPH          ; 6.68  @6.90
                        SetupTest       24h,ras2496,2496h
        ras2496:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOS32QUERYMEM   MACRO                   ; SCI: memory\vmapi.c
                        IFDEF   MMIOPH          ; 6.68  @6.82
                        SetupTest32     24h,ras2497,2497h

                        SaveReg <eax,edi>
                        mov     edi,ss:[esp+SIZETHUNKSEF+10h]
                        mov     eax,ds:[edi]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Actual Size

                        mov     edi,ss:[esp+SIZETHUNKSEF+14h]
                        mov     eax,ds:[edi]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Flags
                        RestoreReg <edi,eax>

                        SendAsDouble    ax              ; DEKKO: ReturnCode
        ras2497:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOS32SETMEM     MACRO                   ; SCI: memory\vmapi.c
                        IFDEF   MMIOPH          ; 6.68  @6.80
                        SetupTest32     24h,ras2498,2498h

                        SendAsDouble    ax              ; DEKKO: Return Code
        ras2498:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSSizeSeg      MACRO                   ; In-Line: memory\selwrk.asm
                        IFDEF   MMIOPH          ; 6.68  @6.90
                        SetupTest       24h,ras2499,2499h
        ras2499:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSUnLockSeg    MACRO                   ; In-Line: memory\selwrk.asm
                        IFDEF   MMIOPH
                        SetupTest       24h,ras249A,249Ah
        ras249A:
                        ExitMMPH
                        ENDIF
                        ENDM

;; 249B - PostDOSSubAlloc ............. see \drv6\src\doscall1\dc1mmpha.inc

;; 249C - PostDOS32SubAlloc ........... see \drv6\src\doscall1\dc1mmph.h

;; 249D - PostDOSSubFree .............. see \drv6\scr\doscall1\dc1mmpha.inc

;; 249E - PostDOS32SubFree ............ see \drv6\scr\doscall1\dc1mmph.h

;; 249F - PostDOSSubSet ............... see \drv6\src\doscall1\dc1mmpha.inc

;; 24A0 - PostDOS32SubSet ............. see \drv6\scr\doscall1\dc1mmph.h

MMPHPostDOS32ALIASMEM   MACRO                   ; SCI: memory\vmapi.c
                        IFDEF   MMIOPH          ; 6.68  @6.82
                        SetupTest32     24h,ras24A1,24A1h

                        SaveReg <edi,eax>
                        mov     edi,ss:[esp+SIZETHUNKSEF+14h]
                        mov     eax,ds:[edi]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Alias Address
                        RestoreReg <eax,edi>

                        SendAsDouble    ax              ; DEKKO: Return Code
        ras24A1:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOS32ALLOCPROTECTEDMEM MACRO            ; SCI: memory\vmapi.c
                        IFDEF   MMIOPH          ; 6.68  @6.82
                        SetupTest32     24h,ras24A2,24A2h

                        SaveReg <edi,eax>
                        mov     edi,ss:[esp+SIZETHUNKSEF+0Ch]
                        mov     eax,ds:[edi]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Address
                        RestoreReg <eax,edi>

                        SendAsDouble    ax              ; DEKKO: Return Code
        ras24A2:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSALLOCPROTHUGE MACRO                  ; SCI: memory\selwrk.asm
                        IFDEF   MMIOPH           ; 6.68
                        SetupTest       24h,ras24A3,24A3h

                        mov     es:[PERF_DATA],ax       ; DEKKO: Base Selector

                        push    di
                        if ?sci_sreg_di eq ?SCI_IN_USE     ; if DI is shadowed,
                           mov     di,[bp].sreg_di         ;   load it
                        endif
                        mov     es:[PERF_DATA],di       ; DEKKO: Return Code
                        pop     di
        ras24A3:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSALLOCPROTSEG MACRO                   ; SCI: memory\selwrk.asm
                        IFDEF   MMIOPH          ; 6.68
                        SetupTest       24h,ras24A4,24A4h

                        mov     es:[PERF_DATA],ax       ; DEKKO: Base Selector

                        push    di
                        if ?sci_sreg_di eq ?SCI_IN_USE     ; if DI is shadowed,
                           mov     di,[bp].sreg_di         ;   load it
                        endif
                        mov     es:[PERF_DATA],di       ; DEKKO: Return Code
                        pop     di
        ras24A4:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSALLOCSHRPROTSEG MACRO                ; SCI: memory\vmname.asm
                        IFDEF   MMIOPH          ; 6.68
                        SetupTest       24h,ras24A5,24A5h

                        mov     es:[PERF_DATA],ax       ; DEKKO: Base Selector

                        push    di
                        if ?sci_sreg_di eq ?SCI_IN_USE     ; if DI is shadowed,
                           mov     di,[bp].sreg_di         ;   load it
                        endif
                        mov     es:[PERF_DATA],di       ; DEKKO: Return Code
                        pop     di
        ras24A5:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOS32QUERYMEMSTATE MACRO                ; SCI: memory\vmapi.c
                        IFDEF   MMIOPH          ; 6.68  @6.82
                        SetupTest32     24h,ras24A6,24A6h

                        SaveReg <eax,edi>
                        mov     edi,ss:[esp+SIZETHUNKSEF+10h]
                        mov     eax,ds:[edi]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Actual Size

                        mov     edi,ss:[esp+SIZETHUNKSEF+14h]
                        mov     eax,ds:[edi]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Flags
                        RestoreReg <edi,eax>

                        SendAsDouble    ax              ; DEKKO: Return Code
        ras24A6:
                        ExitMMPH
                        ENDIF
                        ENDM

;; 24A7 - PostDOSSubUnSet ............. see \drv6\src\doscalle\dc1mmph.h


;****************************************************************************
;
;       FILESYSTEMS: External Interface  -  Major Code 30h
;
;****************************************************************************

MMPHPreDOSBUFRESET      MACRO                   ; SCI: filesys\misc.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest       30h,ras3001,3001h
        ras3001:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSCHGFILEPTR    MACRO                   ; SCI: filesys\fhandle.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest       30h,ras3002,3002h

                        SendAsDouble   bx               ; DEKKO: File Handle
                                                ; added 08/20/93 Torgny Stadler
                                                ; PTR 70953
                        SendAsDouble   ax               ; DEKKO: Move Type
                        SendAsDouble   dx,cx            ; DEKKO: Move Distance
        ras3002:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSCLOSE         MACRO                   ; SCI: filesys\fhandle.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest       30h,ras3003,3003h

                        SendAsDouble    bx              ; DEKKO: File Handle
        ras3003:
                        ExitMMPH
                        ENDIF
                        ENDM
                                                                       ;paa04234

MMPHPreDOSDELETE        MACRO                   ; SCI: filesys\file.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest       30h,ras3004,3004h
        ras3004:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSDUPHANDLE     MACRO                   ; SCI: filesys\fhandle.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest       30h,ras3005,3005h
        ras3005:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSFILELOCKS     MACRO                   ; SCI: filesys\lock.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest       30h,ras3006,3006h
        ras3006:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSMKDIR         MACRO                   ; SCI: filesys\path.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest       30h,ras3007,3007h
        ras3007:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSMOVE          MACRO                   ; SCI: filesys\file.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest       30h,ras3008,3008h
        ras3008:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSNEWSIZE       MACRO                   ; SCI: filesys\fhandle.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest       30h,ras3009,3009h
        ras3009:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSOPEN          MACRO                   ; SCI: filesys\file.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest       30h,ras300A,300Ah

                        SaveReg <ds,di>

                        mov     di,bx                   ;    build offset to the
                        add     di,opns_NamePtr         ;       filename pointer
                        lds     di,dword ptr ss:[di]    ;    load pointer
                        SendAsciiz      300A            ; DEKKO: File Name

                        RestoreReg <di,ds>
        ras300A:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSIREAD         MACRO                   ; SCI: filesys\fhandle.asm
                        IFDEF   MMIOPH          ; 6.62  @6.80
                        SetupTest       30h,ras300B,300Bh

                        SendAsDouble    bx              ; DEKKO: File Handle
        ras300B:
                        ExitMMPH
                        ENDIF
                        ENDM

;; 300C - PreDOSReadAsync ............. see \drv6\src\doscall1\dc1mmpha.inc

MMPHPreDOSRMDIR         MACRO                   ; SCI: filesys\path.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest       30h,ras300D,300Dh
        ras300D:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSSELECTDISK    MACRO                   ; SCI: filesys\getset2.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest       30h,ras300E,300Eh
        ras300E:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSSETFHANDSTATE MACRO                   ; SCI: filesys\fhandle.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest       30h,ras300F,300Fh
        ras300F:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSSETFILEMODE   MACRO                   ; SCI: filesys\finfo.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest       30h,ras3010,3010h
        ras3010:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSSETVERIFY     MACRO                   ; SCI: filesys\getset2.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest       30h,ras3011,3011h
        ras3011:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSIWRITE        MACRO                   ; SCI: filesys\fhandle.asm
                        IFDEF   MMIOPH          ; 6.62  @6.80
                        SetupTest       30h,ras3012,3012h

                        SendAsDouble    bx              ; DEKKO: File Handle
        ras3012:
                        ExitMMPH
                        ENDIF
                        ENDM

;; 3013 - PreDOSWriteAsync ............ see \drv6\src\doscall1\dc1mmpha.inc

MMPHPreDOSCHDIR         MACRO                   ; SCI: filesys\path.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest       30h,ras3014,3014h
        ras3014:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSFINDCLOSE     MACRO                   ; SCI: filesys\dossrch.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest       30h,ras3015,3015h
        ras3015:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSFINDFIRST     MACRO                   ; SCI: filesys\dossrch.asm
                        IFDEF   MMIOPH          ; 6.66
                        SetupTest       30h,ras3016,3016h

                        SaveReg <ds,di>
                        lds     di,[bp].sreg_tempbuf1
                        SendAsciiz      3016            ; DEKKO: File Name
                        RestoreReg <di,ds>
        ras3016:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSFINDNEXT      MACRO                   ; SCI: filesys\dossrch.asm
                        IFDEF   MMIOPH          ; 6.66  @6.80
                        SetupTest       30h,ras3017,3017h

                        SendAsDouble    bx              ; DEKKO: Dir Handle
        ras3017:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSFINDFIRST2    MACRO                   ; SCI: filesys\dossrch.asm
                        IFDEF   MMIOPH          ; 6.66
                        SetupTest       30h,ras3018,3018h

                        SaveReg <ds,di>
                        lds     di,[bp].sreg_tempbuf1
                        SendAsciiz      3018            ; DEKKO: File Name
                        RestoreReg <di,ds>
        ras3018:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSMKDIR2        MACRO                   ; SCI: filesys\path.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest       30h,ras3019,3019h
        ras3019:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSOPEN2         MACRO                   ; SCI: filesys\file.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest       30h,ras301A,301Ah

                        SaveReg <ds,di>

                        mov     di,bx                   ;    build offset to the
                        add     di,opn2s_NamePtr        ;       filename pointer
                        lds     di,dword ptr ss:[di]    ;    load pointer
                        SendAsciiz      301A            ; DEKKO: File Name

                        RestoreReg <di,ds>
        ras301A:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSQCURDIR       MACRO                   ; SCI: filesys.path.asm
                        IFDEF   MMIOPH          ; 6.66  @6.80
                        SetupTest       30h,ras301B,301Bh

                        push    dx
                        xor     dh,dh
                        SendAsDouble    dx              ; DEKKO: Drive Number
                        pop     dx
        ras301B:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSQCURDISK      MACRO                   ; SCI: dilesys\getset2.asm
                        IFDEF   MMIOPH          ; 6.68
                        SetupTest       30h,ras301C,301Ch
        ras301C:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSQFHANDSTATE   MACRO                   ; SCI: filesys\fhandle.asm
                        IFDEF   MMIOPH          ; 6.68  @6.80
                        SetupTest       30h,ras301D,301Dh

                        SendAsDouble    bx              ; DEKKO: File Handle
        ras301D:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSQFILEINFO     MACRO                   ; SCI: filesys\finfo.asm
                        IFDEF   MMIOPH          ; 6.68  @6.80
                        SetupTest       30h,ras301E,301Eh

                        SendAsDouble    bx              ; DEKKO: File Handle

                        SendAsDouble    dx              ; DEKKO: info Level
        ras301E:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSQFILEMODE     MACRO                   ; SCI: filesys\finfo.asm
                        IFDEF   MMIOPH          ; 6.68
                        SetupTest       30h,ras301F,301Fh

                        SaveReg <ds,di>
                        lds     di,[bp].sreg_tempbuf1
                        SendAsciiz      301F            ; DEKKO: File Name
                        RestoreReg <di,ds>
        ras301F:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSQFSINFO       MACRO                   ; SCI: filesys\fsinfo.asm
                        IFDEF   MMIOPH          ; 6.68  @6.80
                        SetupTest       30h,ras3020,3020h

                        SendAsDouble    dx              ; DEKKO: Drive Number

                        SendAsDouble    ax              ; DEKKO: Info Level
        ras3020:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSQHANDTYPE     MACRO                   ; SCI: filesys\fhandle.asm
                        IFDEF   MMIOPH          ; 6.68  @6.80
                        SetupTest       30h,ras3021,3021h

                        SendAsDouble    bx              ; DEKKO: Handle
        ras3021:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSQVERIFY       MACRO                   ; SCI: filesys\getset2.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest       30h,ras3022,3022h
        ras3022:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSSETFILEINFO   MACRO                   ; SCI: filesys\finfo.asm
                        IFDEF   MMIOPH          ; 6.68  @6.80
                        SetupTest       30h,ras3023,3023h

                        SendAsDouble    dx              ; DEKKO: Info Level
        ras3023:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSSETFSINFO     MACRO                   ; SCI: filesys\fsinfo.asm
                        IFDEF   MMIOPH          ; 6.68  @6.80
                        SetupTest       30h,ras3024,3024h

                        SendAsDouble    ax              ; DEKKO: Info Level
        ras3024:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSSETMAXFH      MACRO                   ; SCI: filesys\fhandle.asm
                        IFDEF   MMIOPH          ; 6.68  @6.80
                        SetupTest       30h,ras3025,3025h

                        SendAsDouble    bx              ; DEKKO: # Handles
        ras3025:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSICOPY         MACRO                   ; SCI: doscall1\doscopy.c
                        IFDEF   MMIOPH          ; 6.68  @6.80
                        SetupTest       30h,ras3026,3026h

                        SaveReg <ds,di>
                        lds     di,[bp].sreg_tempbuf2
                        SendAsciiz      3026a           ; DEKKO: SourceName

                        lds     di,[bp].sreg_tempbuf1
                        SendAsciiz      3026b           ; DEKKO: SourceName

                        SendAsDouble    cx              ; DEKKO: OpMode

                        RestoreReg <di,ds>
        ras3026:
                        ExitMMPH
                        ENDIF
                        ENDM

;; 3027 - PreDOSSearchPath ............ see \drv6\src\doscall1\dc1mmpha.inc

MMPHPreDOSEDITNAME      MACRO                   ; SCI: filesys\metachar.asm
                        IFDEF   MMIOPH          ; 6.68  @6.80
                        SetupTest       30h,ras3028,3028h

                        SaveReg <ds,di>
                        lds     di,[bp].sreg_tempbuf1
                        SendAsciiz      3028a           ; DEKKO: Edit String

                        lds     di,[bp].sreg_tempbuf2
                        SendAsciiz      3028b           ; DEKKO: Source String

                        SendAsDouble    bx              ; DEKKO: Edit Level
                        RestoreReg <di,ds>
        ras3028:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSFILEIO        MACRO                   ; SCI: filesys\fhandle.asm
                        IFDEF   MMIOPH          ; 6.68  @6.80
                        SetupTest       30h,ras3029,3029h

                        SendAsDouble    dx              ; DEKKO: File Handle
        ras3029:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSFINDFROMNAME  MACRO                   ; SCI: filesys\dossrch.asm
                        IFDEF   MMIOPH          ; 6.66  @6.80
                        SetupTest       30h,ras302A,302Ah

                        SaveReg <ds,di,ax>
                                    ; ss:bx = ss:[bp].kstk_args -> FFNameStruc
                                                        ;    see: argframe.inc
                        lds     di,[bp].sreg_tempbuf1
                        SendAsciiz      302A            ; DEKKO: Name

                        mov     ax,[bp].kstk_args+4     ;    get lo word
                        mov     di,[bp].kstk_args+6     ;    get hi word
                        SendAsDouble    ax,di           ; DEKKO: Position

                        mov     ax,[bp].kstk_args+18
                        SendAsDouble    ax              ; DEKKO: DirHandle

                        RestoreReg <ax,di,ds>
        ras302A:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSFINDNOTIFYCLOSE MACRO                 ; SCI: filesys\notify.asm
                        IFDEF   MMIOPH          ; 6.68  @6.80
                        SetupTest       30h,ras302B,302Bh

                        SendAsDouble    bx              ; DEKKO: Dir Handle
        ras302B:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSFINDNOTIFYFIRST MACRO                 ; SCI: filesys\notify.asm
                        IFDEF   MMIOPH          ; 6.66
                        SetupTest       30h,ras302C,302Ch

                        SaveReg <ds,di>
                                 ; ss:bx = ss:[bp].kstk_args -> FindFirstStruc
                                                        ;    see: argframe.inc

                        lds     di,[bp].sreg_tempbuf1
                        SendAsciiz      302C            ; DEKKO: Path Name

                        mov     di,[bp].kstk_args+20
                        SendAsDouble    di              ; DEKKO: Attribute

                        mov     di,[bp].kstk_args+8
                        SendAsDouble    di              ; DEKKO: Info Level

                        SendAsDouble    ax,dx           ; DEKKO: timeout

                        RestoreReg <di,ds>              ; restore regs used
        ras302C:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSFINDNOTIFYNEXT MACRO                  ; SCI: filesys\notify.asm
                        IFDEF   MMIOPH          ; 6.68  @6.80
                        SetupTest       30h,ras302D,302Dh

                        push    si
                        if ?sci_sreg_si eq ?SCI_IN_USE     ; if SI is shadowed,
                           mov     si,[bp].sreg_si         ;   load it
                        endif
                        SendAsDouble    si              ; DEKKO: Change Count
                        pop     si

                        SendAsDouble    bx              ; DEKKO: Dir Handle
        ras302D:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSFSATTACH      MACRO                   ; SCI: filesys\fsctl.asm
                        IFDEF   MMIOPH          ; 6.66  @6.80
                        SetupTest       30h,ras302E,302Eh

                        SaveReg <di,ds>

                        lds     di,[bp].sreg_tempbuf2
                        SendAsciiz      302Ea           ; DEKKO: Device Name

                        lds     di,[bp].sreg_tempbuf1
                        SendAsciiz      302Eb           ; DEKKO: FSD Name

                        SendAsDouble    ax              ; DEKKO: opflag

                        RestoreReg <ds,di>
        ras302E:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSFSCTL         MACRO                   ; SCI: filesys\fsctl.asm
                        IFDEF   MMIOPH          ; 6.68
                        SetupTest       30h,ras302F,302Fh

                        SaveReg <ds,di>

                        lds     di,[bp].sreg_tempbuf1
                        SendAsciiz      302F            ; DEKKO: Route Name

                        SendAsDouble    cx              ; DEKKO: File Handle

                        SendAsDouble    ax              ; DEKKO: Route Method

                        RestoreReg <di,ds>
        ras302F:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSOPLOCKRELEASE MACRO                   ; SCI: filesys\oplock.asm
                        IFDEF   MMIOPH          ; 6.68
                        SetupTest       30h,ras3030,3030h

                        SaveReg <ds,si,ax>
                        mov     ds,[bp].sreg_ds         ;    get shadow DS
                        if ?sci_sreg_si eq ?SCI_IN_USE  ;    if SI is shadowed,
                           mov     si,[bp].sreg_si      ;      load it
                        endif
                        mov     ax,ds:[si]
                        mov     si,ds:[si+2]
                        SendAsDouble    ax,si           ; DEKKO: Kernel Key
                        RestoreReg <ax,si,ds>

                        mov     es:[PERF_DATA],cx       ; DEKKO: Flags
        ras3030:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSOPLOCKWAIT    MACRO                   ; SCI: filesys\oplock.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest       30h,ras3031,3031h
        ras3031:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSQFSATTACH     MACRO                   ; SCI: filesys\fsctl.asm
                        IFDEF   MMIOPH          ; 6.68  @6.80
                        SetupTest       30h,ras3032,3032h

                        SaveReg <ds,di>

                        lds     di,[bp].sreg_tempbuf1
                        SendAsciiz      3032            ; DEKKO: Device Name

                        SendAsDouble    ax              ; DEKKO: Info Level

                        RestoreReg <di,ds>
        ras3032:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSQPATHINFO     MACRO                   ; SCI: filesys\finfo.asm
                        IFDEF   MMIOPH          ; 6.68  @6.80
                        SetupTest       30h,ras3033,3033h

                        SaveReg <ds,di>

                        lds     di,[bp].sreg_tempbuf1
                        SendAsciiz      3033            ; DEKKO: Path Name

                        SendAsDouble    bx              ; DEKKO: Info Level
                        RestoreReg <di,ds>
        ras3033:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSQSYSINFO      MACRO                   ; SCI: filesys\getset2.asm
                        IFDEF   MMIOPH          ; 6.68  @6.80
                        SetupTest       30h,ras3034,3034h

                        push    si
                        if ?sci_sreg_si eq ?SCI_IN_USE  ;    if SI is shadowed,
                           mov     si,[bp].sreg_si      ;      load it
                        endif
                        SendAsDouble    si              ; DEKKO: Index
                        pop     si
        ras3034:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSSETPATHINFO   MACRO                   ; SCI: filesys\finfo.asm
                        IFDEF   MMIOPH          ; 6.66
                        SetupTest       30h,ras3035,3035h

                        SaveReg <ds,di>              ; save regs used

                        lds     di,[bp].sreg_tempbuf1
                        SendAsciiz      3035            ; DEKKO: Device Name

                        SendAsDouble    bx              ; DEKKO: Info Level

                        RestoreReg <di,ds>           ; restore regs used
        ras3035:
                        ExitMMPH
                        ENDIF
                        ENDM


MMPHPreDOSFORCEDELETE   MACRO                   ; SCI: filesys\file.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest       30h,ras3036,3036h
        ras3036:
                        ExitMMPH
                        ENDIF
                        ENDM
                                                                       ;b726911
MMPHPreDOS32IREAD       MACRO                   ; SCI: filesys\fs32api.asm
                        IFDEF   MMIOPH          ; 6.62  @6.80
                        SetupTest32      30h,ras3040,3040h

                        push    ax
                        mov     ax,ss:[esp+SIZETHUNKSEF+6]
                        SendAsDouble    ax              ; DEKKO: File Handle
                        pop     ax
        ras3040:
                        ExitMMPH
                        ENDIF
                        ENDM
                                                                       ;b726911
MMPHPreDOS32IWRITE      MACRO                   ; SCI: filesys\fs32api.asm
                        IFDEF   MMIOPH          ; 6.62  @6.80
                        SetupTest32     30h,ras3041,3041h

                        push    ax
                        mov     ax,ss:[esp+SIZETHUNKSEF+6]
                        SendAsDouble    ax              ; DEKKO: File Handle
                        pop     ax
        ras3041:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSBUFRESET     MACRO                   ; SCI: filesys\misc.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest       30h,ras3081,3081h
        ras3081:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSCHGFILEPTR   MACRO                   ; SCI: filesys\fhandle.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest       30h,ras3082,3082h
                                                ; added 08/20/93 Torgny Stadler
                                                ; PTR 70953
                        SendAsDouble    ax,dx           ; DEKKO: NewFilePtr
        ras3082:
                        ExitMMPH
                        ENDIF
                        ENDM


MMPHPostDOSCLOSE        MACRO                   ; SCI: filesys\fhandle.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest       30h,ras3083,3083h
        ras3083:
                        ExitMMPH
                        ENDIF
                        ENDM
                                                                       ;paa04234

MMPHPostDOSDELETE       MACRO                   ; SCI: filesys\file.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest       30h,ras3084,3084h
        ras3084:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSDUPHANDLE    MACRO                   ; SCI: filesys\fhandle.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest       30h,ras3085,3085h
        ras3085:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSFILELOCKS    MACRO                   ; SCI: filesys\lock.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest       30h,ras3086,3086h
        ras3086:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSMKDIR        MACRO                   ; SCI: filesys\path.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest       30h,ras3087,3087h
        ras3087:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSMOVE         MACRO                   ; SCI: filesys\file.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest       30h,ras3088,3088h
        ras3088:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSNEWSIZE      MACRO                   ; SCI: filesys\fhandle.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest       30h,ras3089,3089h
        ras3089:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSOPEN         MACRO                   ; SCI: filesys\file.asm
                        IFDEF   MMIOPH          ; 6.62  @6.80
                        SetupTest       30h,ras308A,308Ah

                        SendAsDouble    ax              ; DEKKO: Handle
        ras308A:
                        ExitMMPH
                        ENDIF
                        ENDM


MMPHPostDOSIREAD        MACRO                   ; SCI: filesys\fhandle.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest       30h,ras308B,308Bh

                        SendAsDouble    cx              ; DEKKO: Bytes Read

                        SendReturnCode  32              ; DEKKO: Return Code
        ras308B:
                        ExitMMPH
                        ENDIF
                        ENDM

;; 308C - PostDOSReadAsync ............ see \drv6\src\doscall1\dc1mmpha.inc

MMPHPostDOSRMDIR        MACRO                   ; SCI: filesys\path.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest       30h,ras308D,308Dh
        ras308D:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSSELECTDISK   MACRO                   ; SCI: filesys\getset2.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest       30h,ras308E,308Eh
        ras308E:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSSETFHANDSTATE MACRO                  ; SCI: filesys\fhandle.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest       30h,ras308F,308Fh
        ras308F:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSSETFILEMODE  MACRO                   ; SCI: filesys\finfo.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest       30h,ras3090,3090h
        ras3090:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSSETVERIFY    MACRO                   ; SCI: filesys\getset2.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest       30h,ras3091,3091h
        ras3091:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSIWRITE       MACRO                   ; SCI: filesys\fhandle.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest       30h,ras3092,3092h

                        SendAsDouble    cx              ; DEKKO: Bytes Written

                        SendReturnCode  32              ; DEKKO: Return Code
        ras3092:
                        ExitMMPH
                        ENDIF
                        ENDM

;; 3093 - PostDOSWriteAsync ........... see \drv6\src\doscall1\dc1mmpha.inc

MMPHPostDOSCHDIR        MACRO                   ; SCI: filesys\path.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest       30h,ras3094,3094h
        ras3094:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSFINDCLOSE    MACRO                   ; SCI: filesys\dossrch.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest       30h,ras3095,3095h
        ras3095:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSFINDFIRST    MACRO                   ; SCI: filesys\dossrch.asm
                        IFDEF   MMIOPH          ; 6.70  @6.80
                        SetupTest       30h,ras3096,3096h

                        SendAsDouble    bx              ; DEKKO: Dir Handle
        ras3096:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSFINDNEXT     MACRO                   ; SCI: filesys\dossrch.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest       30h,ras3097,3097h
        ras3097:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSFINDFIRST2   MACRO                   ; SCI: filesys\dossrch.asm
                        IFDEF   MMIOPH          ; 6.72  @6.80
                        SetupTest       30h,ras3098,3098h

                        SendAsDouble    bx              ; DEKKO: Dir Handle
        ras3098:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSMKDIR2       MACRO                   ; SCI: filesys\path.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest       30h,ras3099,3099h
        ras3099:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSOPEN2        MACRO                   ; SCI: filesys\file.asm
                        IFDEF   MMIOPH          ; 6.62  @6.80
                        SetupTest       30h,ras309A,309Ah

                        SendAsDouble    ax              ; DEKKO: Handle
        ras309A:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSQCURDIR      MACRO                   ; SCI: filesys\path.asm
                        IFDEF   MMIOPH          ; 6.74
                        SetupTest       30h,ras309B,309Bh

                        SaveReg <ax,ds,di>

                        if ?sci_sreg_di eq ?SCI_IN_USE  ; if DI is shadowed,
                           mov     ax,[bp].sreg_di      ;   set AX = shadow DI
                        else                            ; otherwise,
                           mov     ax,di              ;   set AX = real DI
                        endif

                        lds     di,dword ptr [bp].kstk_args+4
                        SendAsciiz      309B            ; DEKKO: Curr Dir Name

                        xor     ah,ah                   ; clear out ah ;b729227
                        SendAsDouble    ax              ; DEKKO: Return Code
                        RestoreReg <di,ds,ax>
        ras309B:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSQCURDISK     MACRO                   ; SCI: filesys\getset2.asm
                        IFDEF   MMIOPH          ; 6.72  @6.82
                        SetupTest       30h,ras309C,309Ch

                        SendAsDouble    bx              ; DEKKO: Cur Drive Numb

                        SendAsDouble    ax,dx           ; DEKKO: Logical Map

        ras309C:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSQFHANDSTATE  MACRO                   ; SCI: filesys\fhandle.asm
                        IFDEF   MMIOPH          ; 6.72
                        SetupTest       30h,ras309D,309Dh

                        SendAsDouble    cx              ; DEKKO: Handle State

                        SendReturnCode  32              ; DEKKO: Return Code
        ras309D:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSQFILEINFO    MACRO                   ; SCI: filesys\finfo.asm
                        IFDEF   MMIOPH          ; 6.72
                        SetupTest       30h,ras309E,309Eh

                        SendReturnCode  32              ; DEKKO: Return Code
        ras309E:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSQFILEMODE    MACRO                   ; SCI: filesys\finfo.asm
                        IFDEF   MMIOPH          ; 6.72  @6.82
                        SetupTest       30h,ras309F,309Fh

                        SendAsDouble    cx              ; DEKKO: File Mode

                        push    di
                        if ?sci_sreg_di eq ?SCI_IN_USE     ; if DI is shadowed,
                           mov     di,[bp].sreg_di         ;   load it
                        endif
                        SendAsDouble    di              ; DEKKO: Return Code
                        pop     di
        ras309F:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSQFSINFO      MACRO                   ; SCI: filesys\fsinfo.asm
                        IFDEF   MMIOPH          ; 6.68
                        SetupTest       30h,ras30A0,30A0h

                        SendReturnCode  32              ; DEKKO: Return Code
        ras30A0:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSQHANDTYPE    MACRO                   ; SCI: filesys\fhandle.asm
                        IFDEF   MMIOPH          ; 6.68  @6.82
                        SetupTest       30h,ras30A1,30A1h

                        push    cx
                        xor     cx,cx
                        mov     cl,al                   ;    want type (AL) only
                        mov     es:[PERF_DATA],cx       ; DEKKO: Handle Type

                        mov     cl,ah                   ;    want bits (AH) only
                        mov     es:[PERF_DATA],cx       ; DEKKO: Handle Bits

                        SendAsDouble    bx              ; DEKKO: Flags

                        if ?sci_sreg_di eq ?SCI_IN_USE  ; if DI is shadowed,
                           mov     cx,[bp].sreg_di      ;   set CX = shadow DI
                        else                            ; otherwise,
                           mov     cx,di                ;   set CX = real DI
                        endif
                        SendAsDouble    cx              ; DEKKO: Return Code
                        pop     cx
        ras30A1:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSQVERIFY      MACRO                   ; SCI: filesys\getset2.asm
                        IFDEF   MMIOPH          ; 6.68
                        SetupTest       30h,ras30A2,30A2h

                        SendAsDouble    ax              ; DEKKO: Verify Flags
        ras30A2:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSSETFILEINFO  MACRO                   ; SCI: filesys\finfo.asm
                        IFDEF   MMIOPH          ; 6.68
                        SetupTest       30h,ras30A3,30A3h

                        SendReturnCode  32              ; DEKKO: Return Code
        ras30A3:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSSETFSINFO    MACRO                   ; SCI: filesys\fsinfo.asm
                        IFDEF   MMIOPH          ; 6.68
                        SetupTest       30h,ras30A4,30A4h

                        SendReturnCode  32              ; DEKKO: Return Code
        ras30A4:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSSETMAXFH     MACRO                   ; SCI: filesys\fhandle.asm
                        IFDEF   MMIOPH          ; 6.68
                        SetupTest       30h,ras30A5,30A5h

                        SendReturnCode  32              ; DEKKO: Return Code
        ras30A5:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSICOPY        MACRO                   ; SCI: doscall1\doscopy.c
                        IFDEF   MMIOPH          ; 6.68
                        SetupTest       30h,ras30A6,30A6h

                        SendReturnCode  32              ; DEKKO: Return Code
        ras30A6:
                        ExitMMPH
                        ENDIF
                        ENDM

;; 30A7 - PostDOSSearchPath ........... see \drv6\src\doscall1\dc1mmpha.inc

MMPHPostDOSEDITNAME     MACRO                   ; SCI: filesys\metachar.asm
                        IFDEF   MMIOPH          ; 6.68  @6.80
                        SetupTest       30h,ras30A8,30A8h

                        SaveReg <ds,di>

                        lds     di,dword ptr [bp].kstk_args+2
                        SendAsciiz      30A8            ; DEKKO: Result String

                        if ?sci_sreg_di eq ?SCI_IN_USE     ; if DI is shadowed,
                           mov     di,[bp].sreg_di         ;   load it
                        endif
                        SendAsDouble    di              ; DEKKO: Return Code

                        RestoreReg <di,ds>
        ras30A8:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSFILEIO       MACRO                   ; SCI: filesys\fhandle.asm
                        IFDEF   MMIOPH          ; 6.68
                        SetupTest       30h,ras30A9,30A9h

                        SendReturnCode  32              ; DEKKO: Return Code
        ras30A9:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSFINDFROMNAME MACRO                   ; SCI: filesys\dossrch.asm
                        IFDEF   MMIOPH          ; 6.66
                        SetupTest       30h,ras30AA,30AAh

                        SendAsDouble    cx              ; DEKKO: Result Count

                        SaveReg <di>
                        if ?sci_sreg_di eq ?SCI_IN_USE     ; if DI is shadowed,
                           mov     di,[bp].sreg_di         ;   load it
                        endif
                        SendAsDouble    di              ; DEKKO: Error Code
                        RestoreReg <di>
        ras30AA:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSFINDNOTIFYCLOSE MACRO                ; SCI: filesys\notify.asm
                        IFDEF   MMIOPH          ; 6.68
                        SetupTest       30h,ras30AB,30ABh

                        SendReturnCode  32              ; DEKKO: Return Code
        ras30AB:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSFINDNOTIFYFIRST MACRO                ; SCI: filesys\notify.asm
                        IFDEF   MMIOPH          ; 6.66
                        SetupTest       30h,ras30AC,30ACh

                        SendAsDouble    cx              ; DEKKO: search count

                        SendAsDouble    bx              ; DEKKO: dir handle

                        SaveReg <di>
                        if ?sci_sreg_di eq ?SCI_IN_USE     ; if DI is shadowed,
                           mov     di,[bp].sreg_di         ;   load it
                        endif
                        SendAsDouble    di              ; DEKKO: return code
                        RestoreReg <di>
        ras30AC:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSFINDNOTIFYNEXT MACRO                 ; SCI: filesys\notify.asm
                        IFDEF   MMIOPH          ; 6.68  @6.80
                        SetupTest       30h,ras30AD,30ADh

                        SendAsDouble    cx              ; DEKKO: Change Count

                        SaveReg <di>
                        if ?sci_sreg_di eq ?SCI_IN_USE     ; if DI is shadowed,
                           mov     di,[bp].sreg_di         ;   load it
                        endif
                        SendAsDouble    di              ; DEKKO: return code
                        RestoreReg <di>
        ras30AD:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSFSATTACH     MACRO                   ; SCI: filesys\fsctl.asm
                        IFDEF   MMIOPH          ; 6.66
                        SetupTest       30h,ras30AE,30AEh

                        SendReturnCode  32              ; DEKKO: Return Code
        ras30AE:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSFSCTL        MACRO                   ; SCI: filesys\fsctl.asm
                        IFDEF   MMIOPH          ; 6.68
                        SetupTest       30h,ras30AF,30AFh

                        SendReturnCode  32              ; DEKKO: Return Code
        ras30AF:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSOPLOCKRELEASE MACRO                  ; SCI: filesys\oplock.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest       30h,ras30B0,30B0h
        ras30B0:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSOPLOCKWAIT   MACRO                   ; SCI: filesys\oplock.asm
                        IFDEF   MMIOPH          ; 6.90
                        SetupTest       30h,ras30B1,30B1h

                        SaveReg <di>
                        if ?sci_sreg_di eq ?SCI_IN_USE     ; if DI is shadowed,
                           mov     di,[bp].sreg_di         ;   load it
                        endif
                        or      di,di                   ;    if zero return code
                        je      ras30B1a                ;       dump values
                                                        ;    else
                        SendAsDouble    0               ;       send zeros
                        SendAsDouble    0
                        jmp     ras30B1b
        ras30B1a:
                        SaveReg <bx,ds>
                        lds     bx,dword ptr [bp].kstk_args
                        mov     di,ds:[bx]              ;    get LO word
                        mov     bx,ds:[bx+2]            ;    get Hi word
                        SendAsDouble    di,bx           ; DEKKO: Server Key

                        lds     bx,dword ptr [bp].kstk_args+4
                        mov     di,ds:[bx]              ;    get LO word
                        mov     bx,ds:[bx+2]            ;    get Hi word
                        SendAsDouble    di,bx           ; DEKKO: Kernel Key
                        RestoreReg <ds,bx>
        ras30B1b:
                        RestoreReg <di>
        ras30B1:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSQFSATTACH    MACRO                   ; SCI: filesys\fsctl.asm
                        IFDEF   MMIOPH          ; 6.68
                        SetupTest       30h,ras30B2,30B2h

                        SendReturnCode  32              ; DEKKO: Return Code
        ras30B2:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSQPATHINFO    MACRO                   ; SCI: filesys\finfo.asm
                        IFDEF   MMIOPH          ; 6.68
                        SetupTest       30h,ras30B3,30B3h

                        SendReturnCode  32              ; DEKKO: Return Code
        ras30B3:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSQSYSINFO     MACRO                   ; SCI: filesys\getset2.asm
                        IFDEF   MMIOPH          ; 6.68
                        SetupTest       30h,ras30B4,30B4h

                        SendReturnCode  32              ; DEKKO: Return Code
        ras30B4:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSSETPATHINFO  MACRO                   ; SCI: filesys\finfo.asm
                        IFDEF   MMIOPH          ; 6.66
                        SetupTest       30h,ras30B5,30B5h

                        SendReturnCode  32              ; DEKKO: Return Code
        ras30B5:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSFORCEDELETE  MACRO                   ; SCI: filesys\file.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest       30h,ras30B6,30B6h
        ras30B6:
                        ExitMMPH
                        ENDIF
                        ENDM
                                                                       ;b726911
MMPHPostDOS32IREAD      MACRO                   ; SCI: filesys\fs32api.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest32     30h,ras30C0,30C0h

                        mov     es:[PERF_DATA_4],ecx    ; DEKKO: Bytes Read

                        SendAsDouble    ax              ; DEKKO: Return Code
        ras30C0:
                        ExitMMPH
                        ENDIF
                        ENDM
                                                                       ;b726911
MMPHPostDOS32IWRITE     MACRO                   ; SCI: filesys\fs32api.asm
                        IFDEF   MMIOPH          ; 6.62
                        SetupTest32     30h,ras30C1,30C1h

                        mov     es:[PERF_DATA_4],ecx    ; DEKKO: Bytes Written

                        SendAsDouble    ax              ; DEKKO: Return Code
        ras30C1:
                        ExitMMPH
                        ENDIF
                        ENDM

;****************************************************************************
;
;       FILESYSTEM (FAT): Internal Interface  -  Major Code 32h
;
;****************************************************************************

MMPHPreClusterAllocate  MACRO                   ; In-Line: filesys\rom.asm
                        IFDEF   MMIOPH          ; 6.68
                        SetupTest       32h,ras3201,3201h

                        mov     es:[PERF_DATA],cx       ; DEKKO: # Clusters
        ras3201:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreCulsterDeallocate MACRO                  ; In-Line: filesys\rom.asm
                        IFDEF   MMIOPH          ; 6.68
                        SetupTest       32h,ras3202,3202h

                        mov     es:[PERF_DATA],bx       ; DEKKO: # Clusters
        ras3202:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreUnlockLockFileRange MACRO                ; In-Line: filesys\lock.asm
                        IFDEF   MMIOPH          ; 6.68  @6.78
                        SetupTest       32h,ras3203,3203h

                        mov     es:[PERF_DATA],ax       ; DEKKO: Lock/Unlock

                        mov     es:[PERF_DATA],bx       ; DEKKO: Handle

                        SendAsDouble    cx,dx           ; DEKKO: Offset

                        SendAsDouble    si,di           ; DEKKO: Length
        ras3203:
                        ExitMMPH
                        ENDIF
                        ENDM


MMPHPostClusterAllocate MACRO                   ; In-Line: filesys\rom.asm
                        IFDEF   MMIOPH          ; 6.68
                        SetupTest       32h,ras3281,3281h

                        mov     es:[PERF_DATA],cx       ; DEKKO: # Clusters
        ras3281:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostCulsterDeallocate MACRO                 ; In-Line: filesys\rom.asm
                        IFDEF   MMIOPH          ; 6.68
                        SetupTest       32h,ras3282,3282h
        ras3282:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostUnlockLockFileRange MACRO               ; In-Line: filesys\lock.asm
                        IFDEF   MMIOPH          ; 6.68
                        SetupTest       32h,ras3283,3283h
        ras3283:
                        ExitMMPH
                        ENDIF
                        ENDM


;****************************************************************************
;
;       FILESYSTEM (HPFS): Internal Interface  -  Major Code 33h
;
;        All hooks are located in \drv6\src\pinball\hdrs\mmph.h
;
;****************************************************************************


;****************************************************************************
;
;       TIMER SERVICES: External Interface  -  Major Code 38h
;
;****************************************************************************

MMPHPreDOSGETDATETIME   MACRO                   ; SCI: task\timserv.asm
                        IFDEF   MMIOPH          ; 6.70
                        SetupTest       38h,ras3801,3801h
        ras3801:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSSETDATETIME   MACRO                   ; SCI: task\time.asm
                        IFDEF   MMIOPH          ; 6.70
                        SetupTest       38h,ras3802,3802h
        ras3802:
                        ExitMMPH
                        ENDIF
                        ENDM

;MMPHPreDOSSLEEP         MACRO                   ; SCI: task\timserv.asm
;                        IFDEF   MMIOPH          ; 6.82
;                        SetupTest       38h,ras3803,3803h
;
;                        push    ax
;                        mov     ax,ss:[bp]              ;    get shadow DI
;                        SendAsDouble    ax,cx           : DEKKO: Time Interval
;                        pop     ax
;        ras3803:
;                        ExitMMPH
;                        ENDIF
;                        ENDM

; macro modified by Toledo to prevent trap5 from occuring

MMPHPreDOSSLEEP         MACRO                   ; SCI: task\tksleep.c
                        IFDEF   MMIOPH          ; 6.82
                        SetupTest32     38h,ras3803,3803h

                        push    eax
                        mov     eax,ss:[esp+SIZETHUNKSEF+04h]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Time Interval
                        pop     eax

        ras3803:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOS32IASYNCTIMER MACRO                   ; SCI: task\timapi.c
                        IFDEF   MMIOPH          ; 6.82
                        SetupTest32     38h,ras3804,3804h

                        push    eax
                        mov     eax,ss:[esp+SIZETHUNKSEF+0Ch]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Sem Handle

                        mov     eax,ss:[esp+SIZETHUNKSEF+08h]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Time Interval
                        pop     eax
        ras3804:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOS32ISTARTTIMER MACRO                   ; SCI: task\timapi.c
                        IFDEF   MMIOPH          ; 6.82
                        SetupTest32     38h,ras3805,3805h

                        push    eax
                        mov     eax,ss:[esp+SIZETHUNKSEF+0Ch]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Sem Handle

                        mov     eax,ss:[esp+SIZETHUNKSEF+08h]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Time Interval
                        pop     eax
        ras3805:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOS32STOPTIMER   MACRO                   ; SCI: task\timapi.c
                        IFDEF   MMIOPH          ; 6.82
                        SetupTest32     38h,ras3806,3806h

                        push    ax
                        mov     ax,ss:[esp+SIZETHUNKSEF+0Ch]
                        SendAsDouble    ax              ; DEKKO: Sem Handle
                        pop     ax
        ras3806:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOS32ASYNCTIMER  MACRO                   ; SCI: task\timapi.c
                        IFDEF   MMIOPH          ; 6.82
                        SetupTest32     38h,ras3807,3807h

                        push    eax
                        mov     eax,ss:[esp+SIZETHUNKSEF+0Ch]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Sem Handle

                        mov     eax,ss:[esp+SIZETHUNKSEF+08h]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Time Interval
                        pop     eax
        ras3807:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOS32STARTTIMER  MACRO                   ; SCI: task\timapi.c
                        IFDEF   MMIOPH          ; 6.82
                        SetupTest32     38h,ras3808,3808h

                        push    eax
                        mov     eax,ss:[esp+SIZETHUNKSEF+0Ch]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Sem Handle

                        mov     eax,ss:[esp+SIZETHUNKSEF+08h]
                        mov     es:[PERF_DATA_4],eax    ; DEKKO: Time Interval
                        pop     eax
        ras3808:
                        ExitMMPH
                        ENDIF
                        ENDM


MMPHPostDOSGETDATETIME  MACRO                   ; SCI: task\timserv.asm
                        IFDEF   MMIOPH          ; 6.70
                        SetupTest       38h,ras3881,3881h
        ras3881:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSSETDATETIME  MACRO                   ; SCI: task\time.asm
                        IFDEF   MMIOPH          ; 6.70
                        SetupTest       38h,ras3882,3882h
        ras3882:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSSLEEP        MACRO                   ; SCI: task\tksleep.c
                        IFDEF   MMIOPH          ; 6.70
                        SetupTest32     38h,ras3883,3883h
        ras3883:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOS32IASYNCTIMER MACRO                  ; SCI: task\timapi.c
                        IFDEF   MMIOPH          ; 6.70
                        SetupTest32     38h,ras3884,3884h
        ras3884:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOS32ISTARTTIMER MACRO                  ; SCI: task\timapi.c
                        IFDEF   MMIOPH          ; 6.70
                        SetupTest32     38h,ras3885,3885h
        ras3885:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOS32STOPTIMER  MACRO                   ; SCI: task\timapi.c
                        IFDEF   MMIOPH          ; 6.70
                        SetupTest32     38h,ras3886,3886h
        ras3886:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOS32ASYNCTIMER MACRO                   ; SCI: task\timapi.c
                        IFDEF   MMIOPH          ; 6.82
                        SetupTest32     38h,ras3887,3887h

                        SendAsDouble    ax              ; DEKKO: Return Code

                        push    ebx
                        mov     ebx,ss:[esp+SIZETHUNKSEF+10h]
                        mov     bx,ds:[ebx]
                        SendAsDouble    bx              ; DEKKO: Time Interval
                        pop     ebx
        ras3887:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOS32STARTTIMER MACRO                   ; SCI: task\timapi.c
                        IFDEF   MMIOPH          ; 6.82
                        SetupTest32     38h,ras3888,3888h

                        SendAsDouble    ax              ; DEKKO: Return Code

                        push    ebx
                        mov     ebx,ss:[esp+SIZETHUNKSEF+10h]
                        mov     bx,ds:[ebx]
                        SendAsDouble    bx              ; DEKKO: Timer Handle
                        pop     ebx
        ras3888:
                        ExitMMPH
                        ENDIF
                        ENDM


;****************************************************************************
;
;       DEVICE MGNT: External Interface  -  Major Code 60h
;
;****************************************************************************

MMPHPreDOSDEVCONFIG     MACRO                   ; SCI: filesys\getset2.asm
                        IFDEF   MMIOPH          ; 6.70
                        SetupTest       60h,ras6001,6001h
        ras6001:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSDEVIOCTL      MACRO                   ; SCI: filesys\devioctl.asm
                        IFDEF   MMIOPH          ; 6.74
                        SetupTest       60h,ras6002,6002h

                        push    cx
                        SendAsDouble    bx              ; DEKKO: DevHandle

                        xor     cx,cx                   ;    start with zero

                        mov     cl,al
                        SendAsDouble    cx              ; DEKKO: Category

                        mov     cl,ah
                        SendAsDouble    cx              ; DEKKO: Function
                        pop     cx
        ras6002:
                        ExitMMPH
                        ENDIF
                        ENDM

;; 6004 - PreDOSMonOpen ............... see \drv6\src\moncalls\dosmon.asm

;; 6005 - PreDOSMonClose .............. see \drv6\src\moncalls\dosmon.asm

;; 6006 - PreDOSMonReg ................ see \drv6\src\moncalls\dosmon.asm

;; 6007 - PreDOSMonRead ............... see \drv6\src\moncalls\dosmon.asm

;; 6008 - PreDOSMonWrite .............. see \drv6\src\moncalls\dosmon.asm

MMPHPreDOSPHYSICALDISK  MACRO                   ; SCI: ???\???.???
                        IFDEF   MMIOPH          ; 6.70
                        SetupTest       60h,ras6009,6009h
        ras6009:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSDEVIOCTL2     MACRO                   ; SCI: filesys\devioctl.asm
                        IFDEF   MMIOPH          ; 6.74
                        SetupTest       60h,ras600A,600Ah

                        push    cx
                        SendAsDouble    bx              ; DEKKO: DevHandle

                        xor     cx,cx                   ;    start with zero

                        mov     cl,al
                        SendAsDouble    cx              ; DEKKO: Category

                        mov     cl,ah
                        SendAsDouble    cx              ; DEKKO: Function
                        pop     cx
        ras600A:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSCLIACCESS     MACRO                   ; SCI: task\api2.asm
                        IFDEF   MMIOPH          ; 6.70
                        SetupTest       60h,ras600B,600Bh
        ras600B:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDOSPORTACCESS    MACRO                   ; SCI: task\api2.asm
                        IFDEF   MMIOPH          ; 6.70
                        SetupTest       60h,ras600C,600Ch

                        mov     es:[PERF_DATA],dx       ; DEKKO: Last Port

                        mov     es:[PERF_DATA],cx       ; DEKKO: First Port
        ras600C:
                        ExitMMPH
                        ENDIF
                        ENDM


MMPHPostDOSDEVCONFIG    MACRO                   ; SCI: filesys\getset2.asm
                        IFDEF   MMIOPH          ; 6.70
                        SetupTest       60h,ras6081,6081h
        ras6081:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSDEVIOCTL     MACRO                   ; SCI: filesys\devioctl.asm
                        IFDEF   MMIOPH          ; 6.74
                        SetupTest       60h,ras6082,6082h
        ras6082:
                        ExitMMPH
                        ENDIF
                        ENDM

;; 6084 - PostDOSMonOpen .............. see \drv6\src\moncalls\dosmon.asm

;; 6085 - PostDOSMonClose ............. see \drv6\src\moncalls\dosmon.asm

;; 6086 - PostDOSMonReg ............... see \drv6\src\moncalls\dosmon.asm

;; 6087 - PostDOSMonRead .............. see \drv6\src\moncalls\dosmon.asm

;; 6088 - PostDOSMonWrite ............. see \drv6\src\moncalls\dosmon.asm

MMPHPostDOSPHYSICALDISK  MACRO                  ; SCI: ???\???.???
                        IFDEF   MMIOPH          ; 6.70
                        SetupTest       60h,ras6089,6089h
        ras6089:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSDEVIOCTL2    MACRO                   ; SCI: filesys\devioctl.asm
                        IFDEF   MMIOPH          ; 6.74
                        SetupTest       60h,ras608A,608Ah
        ras608A:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSCLIACCESS    MACRO                   ; SCI: task\api2.asm
                        IFDEF   MMIOPH          ; 6.70
                        SetupTest       60h,ras608B,608Bh

                        SendReturnCode  16              ; DEKKO: Return Code
        ras608B:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSPORTACCESS   MACRO                   ; SCI: task\api2.asm (stub)
                        IFDEF   MMIOPH          ; 6.70
                        SetupTest       60h,ras608C,608Ch

                        SendReturnCode  16              ; DEKKO: Return Code
        ras608C:
                        ExitMMPH
                        ENDIF
                        ENDM


;****************************************************************************
;
;       DEVHELPS: Internal Interface  -  Major Code 61h
;
;****************************************************************************

MMPHDevHlpTables        MACRO                   ; In-Line dev\dhrouter.asm
                        IFDEF   MMIOPH          ; 6.80  @6.104

        mmph_mc_table   label byte
        mmph_mt0 db 1 dup ( 01h, 02h, 03h, 04h, 05h, 06h, 07h, 08h, 09h, 0Ah )
        mmph_mt1 db 1 dup ( 0Bh, 0Ch, 0Dh, 0Eh, 0Fh, 10h, 11h, 12h, 13h, 14h )
        mmph_mt2 db 1 dup ( 15h, 00h, 17h, 18h, 19h, 1Ah, 1Bh, 1Ch, 1Dh, 1Eh )
        mmph_mt3 db 1 dup ( 1Fh, 20h, 21h, 22h, 23h, 24h, 25h, 26h, 27h, 33h )
        mmph_mt4 db 1 dup ( 34h, 36h, 37h, 38h, 3Ah, 2Fh, 30h, 31h, 32h, 28h )
        mmph_mt5 db 1 dup (  0h, 2Eh, 29h, 2Ah, 2Bh, 2Ch, 35h,  0h, 3Bh, 3Ch )
        mmph_mt6 db 1 dup ( 3Dh, 3Eh,  0h,  0h,  0h,  0h,  0h,  0h,  0h,  0h )
        mmph_mt7 db 1 dup (  0h,  0h,  0h,  0h,  0h,  0h,  0h,  0h,  0h,  0h )
        mmph_mt8 db 1 dup (  0h, 4Eh,  0h, 48h,  0h, 45h, 47h, 42h, 43h, 46h )
        mmph_mt9 db 1 dup ( 44h,  0h, 4Ah, 49h, 4Bh, 4Dh, 4Ch,  0h,  0h,  0h )

        ;;   Legend:    00 - major/minor code only
        ;;              01 - AX:BX=%d DH=%w
        ;;              02 - AX:BX=%d
        ;;              03 - ES:BX=%d DS:SI=%d
        ;;              04 - DS:SI=%a
        ;;              05 - ES:BX=%a
        ;;              06 - DS:BX=%a
        ;;              07 - AX=%w
        ;;              08 - BX=%w
        ;;              09 - ES:SI=%a DS:DI=%a AX=%w
        ;;              0A - ES=%w SI=%w DI=%w CX=%w AX=%w DX=%w
        ;;              0B - DS:SI=%a CX=%w AX=%w DX=%w
        ;;              0C - AH=%w
        ;;              0D - AL=%w BL=%w DS=%w
        ;;              0E - AX=%w DS=%w
        ;;              0F - AX=%w DH=%w DS:SI=%a
        ;;              10 - DH=%w DS:SI=%a
        ;;              11 - AX=%w CX=%w DI=%w DH=%w
        ;;              12 - EAX=%d ECX=%d EDI=%d
        ;;              13 - EAX=%d
        ;;              14 - EAX=%d EBX=%d ECX=%d
        ;;              15 - DS:ESI=address to read 3 %d
        ;;              16 - AX=%w EBX=%d ECX=%d
        ;;              17 - AX=%w ECX=%d DH=%d EDI=%f
        ;;              18 - ECX=%d EDI=%f
        ;;              19 - AX=%w ESI=%d
        ;;              20 - BX=%w AX=%w

        mmph_pre_jmp_table  label byte
        mmph_pjt0 db 1 dup ( 00h, 00h, 00h, 00h, 01h, 02h, 02h, 02h, 02h, 03h )
        mmph_pjt1 db 1 dup ( 04h, 03h, 03h, 00h, 05h, 06h, 06h, 06h, 06h, 07h )
        mmph_pjt2 db 1 dup ( 02h, 00h, 04h, 02h, 02h, 02h, 08h, 08h, 08h, 00h )
        mmph_pjt3 db 1 dup ( 00h, 09h, 0Ah, 20h, 0Bh, 07h, 00h, 0Ch, 00h, 11h )
        mmph_pjt4 db 1 dup ( 00h, 00h, 00h, 00h, 00h, 00h, 00h, 04h, 04h, 07h )
        mmph_pjt5 db 1 dup ( 00h, 00h, 0Dh, 0Eh, 0Fh, 10h, 0Eh, 00h, 00h, 00h )
        mmph_pjt6 db 1 dup ( 00h, 00h, 00h, 00h, 00h, 00h, 00h, 00h, 00h, 00h )
        mmph_pjt7 db 1 dup ( 00h, 00h, 00h, 00h, 00h, 00h, 00h, 00h, 00h, 00h )
        mmph_pjt8 db 1 dup ( 00h, 19h, 00h, 07h, 00h, 14h, 15h, 12h, 13h, 14h )
        mmph_pjt9 db 1 dup ( 14h, 00h, 16h, 07h, 12h, 18h, 17h, 00h, 00h, 00h )

        ;;
        ;;   Legend:    00 - major/minor code only
        ;;              81 - AX:BX=%d
        ;;              82 - ES:BX=%d
        ;;              83 - CF=%w AX:BX=%d
        ;;              84 - CF=%w
        ;;              85 - AX=%w
        ;;              86 - CF=%w AX=%w
        ;;              87 - CX:DX=%a CF=%w
        ;;              88 - EAX=%d CF=%w
        ;;              89 - EAX=%d
        ;;              8A - CF=%d
        ;;              8B - AX=%d
        ;;              8C - ES=%w BX=%w
        ;;              99 - EAX=%d ????=%3d

        mmph_post_jmp_table  label byte
        mmph_pjtA db 1 dup ( 00h, 00h, 00h, 00h, 00h, 00h, 00h, 00h, 81h, 00h )
        mmph_pjtB db 1 dup ( 82h, 00h, 00h, 82h, 00h, 00h, 00h, 00h, 00h, 81h )
        mmph_pjtC db 1 dup ( 00h, 00h, 81h, 8Ch, 83h, 00h, 00h, 84h, 00h, 00h )
        mmph_pjtD db 1 dup ( 00h, 84h, 85h, 84h, 85h, 85h, 00h, 00h, 00h, 84h )
        mmph_pjtE db 1 dup ( 00h, 00h, 00h, 00h, 00h, 00h, 00h, 84h, 84h, 00h )
        mmph_pjtF db 1 dup ( 00h, 00h, 86h, 84h, 84h, 84h, 87h, 00h, 00h, 00h )
        mmph_pjtG db 1 dup ( 00h, 00h, 00h, 00h, 00h, 00h, 00h, 00h, 00h, 00h )
        mmph_pjtH db 1 dup ( 00h, 00h, 00h, 00h, 00h, 00h, 00h, 00h, 00h, 00h )
        mmph_pjtI db 1 dup ( 00h, 8Ah, 00h, 8Bh, 00h, 99h, 89h, 88h, 89h, 8Ah )
        mmph_pjtJ db 1 dup ( 8Ah, 00h, 89h, 8Ah, 89h, 8Ah, 89h, 00h, 00h, 00h )

                        ENDIF
                        ENDM


MMPHPreDevHelpTest      MACRO                   ; In-Line dev\dhrouter.asm
                        IFDEF   MMIOPH          ; 6.80
                        TestTrace PERFTRACE             ; MMPH Tracing On ?
                        jz      dvh_PreSysTrace         ; no-> jump
                        TestTrace 61h                   ; maj code on?
                        jnz     mmph_PreDevHelp         ; yes -> jump
                        jmp     dvh_PreTraceDone
                     dvh_PreSysTrace:
                        ENDIF
                        ENDM

MMPHPreDevHelp          MACRO                   ; In-Line dev\dhrouter.asm
                        IFDEF   MMIOPH          ; 6.80  @6.104
                                Public mmph_PreDevHelp
                        Procedure mmph_PreDevHelp

        ;;      DL contains index into MMPH_DevHlp_Table for the helper
        ;;      routine invoked. This value is used here to index into both
        ;;      the minor code table & the jump table.

                        SaveReg <fs,di>

                        movzx   di,dl
                        cmp     cs:mmph_mc_table[di],0  ; check if mc_tbl = 0
                        je      ras_pre61               ; if 0, no trace (exit)

                        DosContext fs
                        push    fs:SISData.SIS_MMIOBase
                        pop     fs                      ; dekko addr loaded

                        push    ax
                        mov     al,cs:mmph_mc_table[di] ;    load minor code
                        mov     ah,61h                  ;    load major code
                        mov     fs:[MAJMIN_CODE],ax     ; DEKKO: maj/min code

                        mov     al,cs:mmph_pre_jmp_table[di]
                        xor     ah,ah
                        mov     di,ax                   ; load DI with jmp table
                        pop     ax                      ;   value and restore AX

                        cmp     di,00h                  ; MC =All minor codes

                        je      ras_pre61               ;     with no other data

        ras6101:        cmp     di,01h                  ; MC =05
                        jne     ras6102
                        SendDouble      bx,ax
                        movzx   di,dh
                        mov     fs:[PERF_DATA],di
                        jmp     ras_pre61

        ras6102:        cmp     di,02h                  ; MC =06,07,08,09,15,18
                        jne     ras6103                 ;     19,1A
                        SendDouble      bx,ax
                        jmp     ras_pre61

        ras6103:        cmp     di,03h                  ; MC =0A,0C,0D
                        jne     ras6104
                        SendDouble      bx,es
                        SendDouble      si,ds
                        jmp     ras_pre61

        ras6104:        cmp     di,04h                  ; MC =0B,17,31,32
                        jne     ras6105
                        SendDouble      ds,si
                        jmp     ras_pre61

        ras6105:        cmp     di,05h                  ; MC =0F
                        jne     ras6106
                        SendDouble      bx,es
                        jmp     ras_pre61

        ras6106:        cmp     di,06h                  ; MC =10,11,12,13
                        jne     ras6107
                        SendDouble      bx,ds
                        jmp     ras_pre61

        ras6107:        cmp     di,07h                  ; MC =14,24,28,48,49
                        jne     ras6108
                        mov     fs:[PERF_DATA],ax
                        jmp     ras_pre61

        ras6108:        cmp     di,08h                  ; MC =1B,1C,1D
                        jne     ras6109
                        mov     fs:[PERF_DATA],bx
                        jmp     ras_pre61

        ras6109:        cmp     di,09h                  ; MC =20
                        jne     ras610A
                        pop     di                      ;    need orginal DI
                        SendDouble      si,es
                        SendDouble      di,ds
                        mov     fs:[PERF_DATA],ax
                        push    di                      ;    for the pop on exit
                        jmp     ras_pre61

        ras610A:        cmp     di,0Ah                  ; MC =21
                        jne     ras610B
                        pop     di                      ;    need orginal DI
                        mov     fs:[PERF_DATA],es
                        mov     fs:[PERF_DATA],si
                        mov     fs:[PERF_DATA],di
                        mov     fs:[PERF_DATA],cx
                        mov     fs:[PERF_DATA],ax
                        mov     fs:[PERF_DATA],dx
                        push    di                      ;    for the pop on exit
                        jmp     ras_pre61

        ras610B:        cmp     di,0Bh                  ; MC =23
                        jne     ras610C
                        SendDouble      si,di
                        mov     fs:[PERF_DATA],cx
                        mov     fs:[PERF_DATA],ax
                        mov     fs:[PERF_DATA],dx
                        jmp     ras_pre61

        ras610C:        cmp     di,0Ch                  ; MC =26
                        jne     ras610D
                        movzx   di,ah
                        mov     fs:[PERF_DATA],di
                        jmp     ras_pre61

        ras610D:        cmp     di,0Dh                  ; MC =29
                        jne     ras610E
                        movzx   di,al
                        mov     fs:[PERF_DATA],di
                        movzx   di,bl
                        mov     fs:[PERF_DATA],di
                        mov     fs:[PERF_DATA],ds
                        jmp     ras_pre61

        ras610E:        cmp     di,0Eh                  ; MC =2A,35
                        jne     ras610F
                        mov     fs:[PERF_DATA],ax
                        mov     fs:[PERF_DATA],ds
                        jmp     ras_pre61

        ras610F:        cmp     di,0Fh                  ; MC =2B
                        jne     ras6110
                        mov     fs:[PERF_DATA],ax
                        movzx   di,dh
                        mov     fs:[PERF_DATA],di
                        SendDouble      si,ds
                        jmp     ras_pre61

        ras6110:        cmp     di,10h                  ; MC =2C
                        jne     ras6111
                        movzx   di,dh
                        mov     fs:[PERF_DATA],di
                        SendDouble      si,ds
                        jmp     ras_pre61

        ras6111:        cmp     di,11h                  ; MC =33
                        jne     ras6112
                        mov     fs:[PERF_DATA],ax
                        mov     fs:[PERF_DATA],cx
                        pop     di                      ;    need orginal DI
                        mov     fs:[PERF_DATA],di
                        push    di                      ;    for the pop on exit
                        movzx   di,dh                   ;    and scratch reg
                        mov     fs:[PERF_DATA],di
                        jmp     ras_pre61

        ras6112:        cmp     di,12h                  ; MC =42,4B
                        jne     ras6113
                        pop     di                      ;    need orginal DI
                        mov     fs:[PERF_DATA_4],eax
                        mov     fs:[PERF_DATA_4],ecx
                        mov     fs:[PERF_DATA_4],edi
                        push    di                      ;    for the pop on exit
                        jmp     ras_pre61

        ras6113:        cmp     di,13h                  ; MC =43
                        jne     ras6114
                        mov     fs:[PERF_DATA_4],eax
                        jmp     ras_pre61

        ras6114:        cmp     di,14h                  ; MC =44,45,46
                        jne     ras6115
                        mov     fs:[PERF_DATA_4],eax
                        mov     fs:[PERF_DATA_4],ebx
                        mov     fs:[PERF_DATA_4],ecx
                        jmp     ras_pre61

        ras6115:        cmp     di,15h                  ; MC =47 @6.85
                        jne     ras6116
                        SaveReg <es,eax>
                        FlatContext es
                        mov     eax,es:[esi]
                        mov     fs:[PERF_DATA_4],eax
                        mov     eax,es:[esi+4]
                        mov     fs:[PERF_DATA_4],eax
                        mov     eax,es:[esi+8]
                        mov     fs:[PERF_DATA_4],eax
                        RestoreReg <eax,es>
                        jmp     ras_pre61

        ras6116:        cmp     di,16h                  ; MC =4A
                        jne     ras6117
                        mov     fs:[PERF_DATA],ax
                        mov     fs:[PERF_DATA_4],ebx
                        mov     fs:[PERF_DATA_4],ecx
                        jmp     ras_pre61

        ras6117:        cmp     di,17h                  ; MC =4C
                        jne     ras6118
                        mov     fs:[PERF_DATA],ax
                        mov     fs:[PERF_DATA_4],ecx
                        movzx   di,dh
                        SendDouble di
                        pop     di                      ;    need orginal DI
                        mov     fs:[PERF_DATA_4],edi
                        push    di                      ;    for the pop on exit
                        jmp     ras_pre61

        ras6118:        cmp     di,18h                  ; MC =4D
                        jne     ras6119
                        pop     di                      ;    need orginal DI
                        mov     fs:[PERF_DATA_4],ecx
                        mov     fs:[PERF_DATA_4],edi
                        push    di                      ;    for the pop on exit
                        jmp     ras_pre61

        ras6119:        cmp     di,19h                  ; MC =4E
                        jne     ras6120
                        mov     fs:[PERF_DATA],ax
                        mov     fs:[PERF_DATA_4],esi
                        jmp     ras_pre61

        ras6120:        cmp     di,20h                  ; MC =22
                        jne     ras_pre61
                        mov     fs:[PERF_DATA],bx
                        mov     fs:[PERF_DATA],ax

        ras_pre61:
                        RestoreReg <di,fs>
                        jmp     dvh_PreTraceDone        ; jmp back DO NOT ret

                        EndProc mmph_PreDevHelp
                        ENDIF
                        ENDM


MMPHPostDevHelpTest     MACRO   RETLABEL        ; In-Line dev\dhrouter.asm
                        local   label01
                       .ERRB   <RETLABEL>       ; Error if return label blank
                        IFDEF   MMIOPH          ; 6.80
                        TestTrace PERFTRACE     ; MMPH Tracing On ?
                        jz      label01         ; no -> Jump
                        TestTrace 61h           ; maj code on?
                        jz      RETLABEL        ; no -> return
                        call    mmph_PostDevHelp
                        jmp     RETLABEL
                       label01:
                        ENDIF
                        ENDM

MMPHPostDevHelp         MACRO                   ; In-Line dev\dhrouter.asm
                        IFDEF   MMIOPH          ; 6.80  @6.108
                                Public mmph_PostDevHelp
                        Procedure mmph_PostDevHelp

        ;;      When called, the lower byte of BP contains the index into
        ;;      into both the minor code table & the jump table. DS is loaded
        ;;      with the DOS Group value.

                        SaveReg <fs,di>
                        pushf                           ; save the CF value

                        mov     di,bp                   ; lo=index, hi=garbage
                        and     di,0FFh                 ; clean out hi byte
                        cmp     cs:mmph_mc_table[di],0  ; check if mc_tbl = 0
                        je      ras_post61              ; if 0, no trace (exit)

                        push    ds:SISData.SIS_MMIOBase
                        pop     fs                      ; dekko addr loaded

                        push    ax
                        mov     al,cs:mmph_mc_table[di] ;    load minor code
                        or      al,80h                  ;    make it post hook
                        mov     ah,61h                  ;    load major code
                        mov     fs:[MAJMIN_CODE],ax     ; DEKKO: maj/min code

                        mov     al,cs:mmph_post_jmp_table[di]
                        xor     ah,ah
                        mov     di,ax                   ; load DI with jmp table
                        pop     ax                      ;   value and restore AX

                        cmp     di,00h                  ; MC =All minor codes
                        je      ras_post61              ;     with no other data

        ras6181:        cmp     di,81h                  ; MC =89,94,97
                        jne     ras6182
                        SendDouble      bx,ax
                        jmp     ras_post61

        ras6182:        cmp     di,82h                  ; MC =8B,8E
                        jne     ras6183
                        SendDouble      bx,es
                        jmp     ras_post61

        ras6183:        cmp     di,83h                  ; MC =99
                        jne     ras6184
                        SendCarryFlag   6183
                        SendDouble      bx,ax
                        jmp     ras_post61

        ras6184:        cmp     di,84h                  ; MC =9C,A0,A2,AA,AB,AC,
                        jne     ras6185                 ;     B5,B6,B7
                        SendCarryFlag   6184
                        jmp     ras_post61

        ras6185:        cmp     di,85h                  ; MC =A1,A3,A4
                        jne     ras6186
                        mov     fs:[PERF_DATA],ax
                        jmp     ras_post61

        ras6186:        cmp     di,86h                  ; MC =A9
                        jne     ras6187
                        SendCarryFlag   6186
                        mov     fs:[PERF_DATA],ax
                        jmp     ras_post61

        ras6187:        cmp     di,87h                  ; MC =B9
                        jne     ras6188
                        SendDouble      dx,cx
                        SendCarryFlag   6187
                        jmp     ras_post61

        ras6188:        cmp     di,88h                  ; MC =C2
                        jne     ras6189
                        SendCarryFlag   6188,_4         ; CF sent as %d
                        mov     fs:[PERF_DATA_4],eax
                        jmp     ras_post61

        ras6189:        cmp     di,89h                  ; MC =C3,C7,CA,CB,CC
                        jne     ras618A
                        mov     fs:[PERF_DATA_4],eax
                        jmp     ras_post61

        ras618A:        cmp     di,8Ah                  ; MC =C4,C6,C9,CD,CE
                        jne     ras618B
                        SendCarryFlag   618A,_4         ; CF sent as %d
                        jmp     ras_post61

        ras618B:        cmp     di,8Bh                  ; MC =C8
                        jne     ras618C
                        SendDouble      ax
                        jmp     ras_post61

        ras618C:        cmp     di,8Ch                  ; MC =98
                        jne     ras6199
                        mov     fs:[PERF_DATA],es
                        mov     fs:[PERF_DATA],bx
                        jmp     ras_post61

        ras6199:        cmp     di,99h                  ; MC =C5 - LOOK AT THIS!
                        jne     ras_post61
                        mov     fs:[PERF_DATA_4],eax
                        mov     fs:[PERF_DATA_4],0
                        mov     fs:[PERF_DATA_4],0
                        mov     fs:[PERF_DATA_4],0

        ras_post61:
                        add     esp,2                   ; "pop" flag word
                        RestoreReg <di,fs>
                        ret                             ; return back since two
                                                        ;    entry points
                        EndProc mmph_PostDevHelp
                        ENDIF
                        ENDM


;****************************************************************************
;
;       DEVHELPS: Internal Interface  -  Major Code 62h
;
;****************************************************************************

MMPHPreDHPhysToVirt     MACRO                   ; In-Line: memory\selphys.asm
                        IFDEF   MMIOPH          ; 6.96
                        SetupTest       62h,ras6201,6201h

                        SendAsDouble    ax,bx           ; DEKKO: Addr to Convert

                        mov     es:[PERF_DATA],cx       ; DEKKO: len of segment
        ras6201:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreDHUnPhysToVirt   MACRO                   ; In-Line: memory\selphys.asm
                        IFDEF   MMIOPH          ; 6.70
                        SetupTest       62h,ras6202,6202h
        ras6202:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDHPhysToVirt    MACRO                   ; In-Line: memory\selphys.asm
                        IFDEF   MMIOPH          ; 6.96
                        SetupTest       62h,ras6281,6281h

                        test    [ptv_dx].HighByte,1     ; Addr in DS:SI or ES:DI
                        jnz     short ras6281a
                                                        ;    VirtMem in DS:SI
                        mov     es:[PERF_DATA],ds       ; DEKKO: Selector
                        mov     es:[PERF_DATA],si       ; DEKKO: Offset
                        jmp     ras6281
        ras6281a:
                        push    ax                      ;    VirtMem in ES:DI
                        mov     ax,ss:[bp-2]            ;    get ES out of stk
                        mov     es:[PERF_DATA],ax       ; DEKKO: Selector
                        mov     es:[PERF_DATA],di       ; DEKKO: Offset
                        pop     ax
        ras6281:
                                                ; added 08/25/93 Torgny Stadler
                                                ; PTR 65619
                        push    di              ; @89166a
                        or      di, 1           ; set  CF = 0, ZF = 0
                        mov     di, 0           ; last line of fix
                        pop     di              ; @89166a
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDHUnPhysToVirt  MACRO                   ; In-Line: memory\selphys.asm
                        IFDEF   MMIOPH          ; 6.70
                        SetupTest       62h,ras6282,6282h
        ras6282:
                        ExitMMPH
                        ENDIF
                        ENDM


;****************************************************************************
;
;       KEYBOARD DEVICE DRIVER: External Interface  -  Major Code 64h
;
;****************************************************************************

MMPHPreDOSBEEP          MACRO                   ; SCI: dev\beep.asm
                        IFDEF   MMIOPH          ; 6.87
                        SetupTest       64h,ras6401,6401h
        ras6401:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostDOSBEEP         MACRO                   ; SCI: dev\beep.asm
                        IFDEF   MMIOPH          ; 6.87
                        SetupTest       64h,ras6481,6481h
        ras6481:
                        ExitMMPH
                        ENDIF
                        ENDM
;****************************************************************************
;
;       BASE SESSION MANAGER - External Interface  -  Major Code 80h
;
;        All hooks are located in \drv6\src\sesmgr\smmmpha.inc
;
;****************************************************************************


;****************************************************************************
;
;       BASE SESSION MANAGER - Internal Interface  -  Major Code 81h
;
;        All hooks are located in \drv6\src\sesmgr\smmmpha.inc
;
;****************************************************************************


;****************************************************************************
;
;       API.ASM
;
;****************************************************************************

MMPHPreDOSQTRACEINFO            MACRO
                                ENDM
MMPHPostDOSQTRACEINFO           MACRO
                                ENDM

MMPHPreDOSFLAGPROCESS           MACRO
                                ENDM
MMPHPostDOSFLAGPROCESS          MACRO
                                ENDM

MMPHPreDOSFREERESOURCE          MACRO
                                ENDM
MMPHPostDOSFREERESOURCE         MACRO
                                ENDM

MMPHPreR0DOSGETINFOSEG          MACRO
                                ENDM
MMPHPostR0DOSGETINFOSEG         MACRO
                                ENDM

MMPHPreDOSGETPROCADDR           MACRO
                                ENDM
MMPHPostDOSGETPROCADDR          MACRO
                                ENDM

MMPHPreDOSGETRESOURCE           MACRO
                                ENDM
MMPHPostDOSGETRESOURCE          MACRO
                                ENDM

MMPHPreDOSGETRESOURCE2          MACRO
                                ENDM
MMPHPostDOSGETRESOURCE2         MACRO
                                ENDM

MMPHPreDOSICANONICALIZE         MACRO
                                ENDM
MMPHPostDOSICANONICALIZE        MACRO
                                ENDM

MMPHPreDOSPROFILE               MACRO
                                ENDM
MMPHPostDOSPROFILE              MACRO
                                ENDM

MMPHPreDOSQPROCSTATUS           MACRO
                                ENDM
MMPHPostDOSQPROCSTATUS          MACRO
                                ENDM

MMPHPreDOSSICG                  MACRO
                                ENDM
MMPHPostDOSSICG                 MACRO
                                ENDM

MMPHPrePANICWRITE               MACRO
                                ENDM
MMPHPostPANICWRITE              MACRO
                                ENDM

;****************************************************************************
;
;       API2.ASM
;
;****************************************************************************

MMPHPreDOSTIMERSTART            MACRO
                                ENDM
MMPHPostDOSTIMERSTART           MACRO
                                ENDM

MMPHPreDOSTIMERSTOP             MACRO
                                ENDM
MMPHPostDOSTIMERSTOP            MACRO
                                ENDM

MMPHPreDOSTIMERASYNC            MACRO
                                ENDM
MMPHPostDOSTIMERASYNC           MACRO
                                ENDM

MMPHPreDOSSETFGND               MACRO
                                ENDM
MMPHPostDOSSETFGND              MACRO
                                ENDM

MMPHPreDOSSGSWITCH              MACRO
                                ENDM
MMPHPostDOSSGSWITCH             MACRO
                                ENDM

MMPHPreDOSSGSWITCHME            MACRO
                                ENDM
MMPHPostDOSSGSWITCHME           MACRO
                                ENDM

MMPHPreDOSSGSWITCHPROC2         MACRO
                                ENDM
MMPHPostDOSSGSWITCHPROC2        MACRO
                                ENDM

MMPHPreDOSSTRUCHECK             MACRO
                                ENDM
MMPHPostDOSSTRUCHECK            MACRO
                                ENDM

MMPHPreDOSSTRURESUPDATE         MACRO
                                ENDM
MMPHPostDOSSTRURESUPDATE        MACRO
                                ENDM

MMPHPreDOSGETSTDA               MACRO
                                ENDM
MMPHPostDOSGETSTDA              MACRO
                                ENDM

MMPHPreDOSLOGENTRY              MACRO
                                ENDM
MMPHPostDOSLOGENTRY             MACRO
                                ENDM

MMPHPreDOSGETLOGBUFFER          MACRO
                                ENDM
MMPHPostDOSGETLOGBUFFER         MACRO
                                ENDM

MMPHPreDOSLOGMODE               MACRO
                                ENDM
MMPHPostDOSLOGMODE              MACRO
                                ENDM

MMPHPreDOSGLOBALSEG             MACRO
                                ENDM
MMPHPostDOSGLOBALSEG            MACRO
                                ENDM

;****************************************************************************
;
;       API32.ASM
;
;****************************************************************************

MMPHPreDOS32ALIASPERFCTRS       MACRO
                                ENDM
MMPHPostDOS32ALIASPERFCTRS      MACRO
                                ENDM

MMPHPreDOS32CLOSEVDD            MACRO
                                ENDM
MMPHPostDOS32CLOSEVDD           MACRO
                                ENDM

MMPHPreDOS32CONFIGUREPERF       MACRO
                                ENDM
MMPHPostDOS32CONFIGUREPERF      MACRO
                                ENDM

MMPHPreDOSCREATEVDM             MACRO
                                ENDM
MMPHPostDOSCREATEVDM            MACRO
                                ENDM

MMPHPreDOS32DECONPERF           MACRO
                                ENDM
MMPHPostDOS32DECONPERF          MACRO
                                ENDM

MMPHPreDOS32EXCEPTIONCALLBACK   MACRO
                                ENDM
MMPHPostDOS32EXCEPTIONCALLBACK  MACRO
                                ENDM

MMPHPreDOS32DYNAMICTRACE        MACRO
                                ENDM
MMPHPostDOS32DYNAMICTRACE       MACRO
                                ENDM

MMPHPreDOS32FREERESOURCE        MACRO
                                ENDM
MMPHPostDOS32FREERESOURCE       MACRO
                                ENDM

MMPHPreDOS32OPENVDD             MACRO
                                ENDM
MMPHPostDOS32OPENVDD            MACRO
                                ENDM

MMPHPreDOS32QUERYDOSPROPERTY    MACRO
                                ENDM
MMPHPostDOS32QUERYDOSPROPERTY   MACRO
                                ENDM

MMPHPreDOS32SETDOSPROPERTY      MACRO
                                ENDM
MMPHPostDOS32SETDOSPROPERTY     MACRO
                                ENDM

MMPHPreDOS32PROFILE             MACRO
                                ENDM
MMPHPostDOS32PROFILE            MACRO
                                ENDM

MMPHPreDOS32QUERYSYSINFO        MACRO
                                ENDM
MMPHPostDOS32QUERYSYSINFO       MACRO
                                ENDM

MMPHPreDOS32QUERYSYSSTATE       MACRO
                                ENDM
MMPHPostDOS32QUERYSYSSTATE      MACRO
                                ENDM

MMPHPreDOS32REGISTERPERFCTRS    MACRO
                                ENDM
MMPHPostDOS32REGISTERPERFCTRS   MACRO
                                ENDM

MMPHPreDOS32REQUESTVDD          MACRO
                                ENDM
MMPHPostDOS32REQUESTVDD         MACRO
                                ENDM

MMPHPreDOS32TMRQUERYFREQ        MACRO
                                ENDM
MMPHPostDOS32TMRQUERYFREQ       MACRO
                                ENDM

MMPHPreDOS32TMRQUERYTIME        MACRO
                                ENDM
MMPHPostDOS32TMRQUERYTIME       MACRO
                                ENDM

MMPHPreDOS32QUERYPAGEUSAGE      MACRO
                                ENDM
MMPHPostDOS32QUERYPAGEUSAGE     MACRO
                                ENDM

MMPHPreDOSQUERYMODFROMCS        MACRO
                                ENDM
MMPHPostDOSQUERYMODFROMCS       MACRO
                                ENDM

MMPHPreDOS32QUERYRESOURCESIZE   MACRO
                                ENDM
MMPHPostDOS32QUERYRESOURCESIZE  MACRO
                                ENDM

MMPHPreDOSLIBINIT               MACRO
                                ENDM
MMPHPostDOSLIBINIT              MACRO
                                ENDM

;MMPHPreDOS32IREAD               MACRO                                 ;b726911
;                                ENDM                                  ;b726911
;MMPHPostDOS32IREAD              MACRO                                 ;b726911
;                                ENDM                                  ;b726911

;MMPHPreDOS32IWRITE              MACRO                                 ;b726911
;                                ENDM                                  ;b726911
;MMPHPostDOS32IWRITE             MACRO                                 ;b726911
;                                ENDM                                  ;b726911

MMPHPreDosRedir                 MACRO
                                ENDM
MMPHPostDosRedir                MACRO
                                ENDM

;****************************************************************************
;
;       APIFS.ASM
;
;****************************************************************************

MMPHPreDOSENUMATTRIBUTE         MACRO
                                ENDM
MMPHPostDOSENUMATTRIBUTE        MACRO
                                ENDM

MMPHPreDOSIFINDNEXT             MACRO
                                ENDM
MMPHPostDOSIFINDNEXT            MACRO
                                ENDM

MMPHPreDOSISETFILEINFO          MACRO
                                ENDM
MMPHPostDOSISETFILEINFO         MACRO
                                ENDM

MMPHPreDOSISETPATHINFO          MACRO
                                ENDM
MMPHPostDOSISETPATHINFO         MACRO
                                ENDM

MMPHPreDOSOPLOCKSHUTDOWN        MACRO
                                ENDM
MMPHPostDOSOPLOCKSHUTDOWN       MACRO
                                ENDM

MMPHPreDOSSHUTDOWN              MACRO
                                ENDM
MMPHPostDOSSHUTDOWN             MACRO
                                ENDM

;****************************************************************************
;
;       SEM.ASM
;
;****************************************************************************

MMPHPreDOSISYSSEMSET            MACRO
                                ENDM
MMPHPostDOSISYSSEMSET           MACRO
                                ENDM

MMPHPreDOSISYSSEMCLEAR          MACRO
                                ENDM
MMPHPostDOSISYSSEMCLEAR         MACRO
                                ENDM

;****************************************************************************
;
;       VDHSERV.ASM
;
;****************************************************************************

MMPHPreVDHCreateSem     MACRO    semtype
                        IFDEF   MMIOPH
                        SetupTest32     8dh,ras8d01,8d01h
;                       mov     es:[PERF_DATA], 4       ; 4 bytes of data
                        mov     es:[PERF_DATA_4], semtype
        ras8d01:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostVDHCreateSem    MACRO    semhandle
                        local ras8d81
                        IFDEF   MMIOPH
                        SetupTest32     8dh,ras8d81,8d81h
;                       mov     es:[PERF_DATA], 4       ; 4 bytes of data
                        mov     es:[PERF_DATA_4], semhandle
        ras8d81:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreVDHDestroySem    MACRO    semhandle
                        IFDEF   MMIOPH
                        SetupTest32     8dh,ras8d02,8d02h
;                       mov     es:[PERF_DATA], 4       ; 4 bytes of data
                        mov     es:[PERF_DATA_4], semhandle
        ras8d02:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostVDHDestroySem   MACRO
                        IFDEF   MMIOPH
                        SetupTest32     8dh,ras8d82,8d82h
        ras8d82:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreVDHWaitEventSem  MACRO    semhandle, timeout
                        IFDEF   MMIOPH
                        SetupTest32     8dh,ras8d03,8d03h
;                       mov     es:[PERF_DATA], 8       ; 8 bytes of data
                        mov     es:[PERF_DATA_4], semhandle
                        mov     es:[PERF_DATA_4], timeout
        ras8d03:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostVDHWaitEventSem MACRO   rc
                        local ras8d83
                        IFDEF   MMIOPH
                        SetupTest32     8dh,ras8d83,8d83h
;                       mov     es:[PERF_DATA], 4       ; 4 bytes of data
                        mov     es:[PERF_DATA_4], rc
        ras8d83:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreVDHReqMutexSem   MACRO    semhandle, timeout
                        IFDEF   MMIOPH
                        SetupTest32     8dh,ras8d04,8d04h
;                       mov     es:[PERF_DATA], 8       ; 8 bytes of data
                        mov     es:[PERF_DATA_4], semhandle
                        mov     es:[PERF_DATA_4], timeout
        ras8d04:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostVDHReqMutexSem  MACRO   rc
                        local ras8d84
                        IFDEF   MMIOPH
                        SetupTest32     8dh,ras8d84,8d84h
;                       mov     es:[PERF_DATA], 4       ; 4 bytes of data
                        mov     es:[PERF_DATA_4], rc
        ras8d84:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreVDHRelMutexSem   MACRO    semhandle
                        IFDEF   MMIOPH
                        SetupTest32     8dh,ras8d05,8d05h
;                       mov     es:[PERF_DATA], 4       ; 4 bytes of data
                        mov     es:[PERF_DATA_4], semhandle
        ras8d05:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostVDHRelMutexSem  MACRO   rc
                        IFDEF   MMIOPH
                        SetupTest32     8dh,ras8d85,8d85h
;                       mov     es:[PERF_DATA], 4       ; 4 bytes of data
                        mov     es:[PERF_DATA_4], rc
        ras8d85:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreVDHResetEventSem MACRO    semhandle
                        IFDEF   MMIOPH
                        SetupTest32     8dh,ras8d06,8d06h
;                       mov     es:[PERF_DATA], 4       ; 4 bytes of data
                        mov     es:[PERF_DATA_4], semhandle
        ras8d06:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostVDHResetEventSem MACRO   rc
                        IFDEF   MMIOPH
                        SetupTest32     8dh,ras8d86,8d86h
;                       mov     es:[PERF_DATA], 4       ; 4 bytes of data
                        mov     es:[PERF_DATA_4], rc
        ras8d86:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreVDHPostEventSem  MACRO    semhandle
                        IFDEF   MMIOPH
                        SetupTest32     8dh,ras8d07,8d07h
;                       mov     es:[PERF_DATA], 4       ; 4 bytes of data
                        mov     es:[PERF_DATA_4], semhandle
        ras8d07:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostVDHPostEventSem MACRO   rc
                        IFDEF   MMIOPH
                        SetupTest32     8dh,ras8d87,8d87h
;                       mov     es:[PERF_DATA], 4       ; 4 bytes of data
                        mov     es:[PERF_DATA_4], rc
        ras8d87:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreVDHQuerySem      MACRO    semhandle
                        IFDEF   MMIOPH
                        SetupTest32     8dh,ras8d08,8d08h
;                       mov     es:[PERF_DATA], 4       ; 4 bytes of data
                        mov     es:[PERF_DATA_4], semhandle
        ras8d08:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostVDHQuerySem     MACRO
                        IFDEF   MMIOPH
                        SetupTest32     8dh,ras8d88,8d88h
        ras8d88:
                        ExitMMPH
                        ENDIF
                        ENDM


;****************************************************************************
;
;       EM86MISC.ASM
;
;****************************************************************************

MMPHPreVDHPushRegs      MACRO    flags
                        local ras8d2F
                        IFDEF   MMIOPH
                        SetupTest32     8dh,ras8d2F,8d2Fh
;                       mov     es:[PERF_DATA], 4       ; 4 bytes of data
                        mov     es:[PERF_DATA_4], flags
        ras8d2F:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostVDHPushRegs     MACRO
                        local ras8dAF
                        IFDEF   MMIOPH
                        SetupTest32     8dh,ras8dAF,8dAFh
        ras8dAF:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreVDHPopRegs       MACRO    flags
                        local ras8d30
                        IFDEF   MMIOPH
                        SetupTest32     8dh,ras8d30,8d30h
;                       mov     es:[PERF_DATA], 4       ; 4 bytes of data
                        mov     es:[PERF_DATA_4], flags
        ras8d30:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostVDHPopRegs      MACRO
                        local ras8dB0
                        IFDEF   MMIOPH
                        SetupTest32     8dh,ras8dB0,8dB0h
        ras8dB0:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreVDHPushStack     MACRO    size
                        local ras8d31
                        IFDEF   MMIOPH
                        SetupTest32     8dh,ras8d31,8d31h
;                       mov     es:[PERF_DATA], 4       ; 4 bytes of data
                        mov     es:[PERF_DATA_4], size
        ras8d31:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostVDHPushStack    MACRO
                        local ras8dB1
                        IFDEF   MMIOPH
                        SetupTest32     8dh,ras8dB1,8dB1h
        ras8dB1:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreVDHPopStack      MACRO    size
                        local ras8d32
                        IFDEF   MMIOPH
                        SetupTest32     8dh,ras8d32,8d32h
;                       mov     es:[PERF_DATA], 4       ; 4 bytes of data
                        mov     es:[PERF_DATA_4], size
        ras8d32:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostVDHPopStack     MACRO
                        local ras8dB2
                        IFDEF   MMIOPH
                        SetupTest32     8dh,ras8dB2,8dB2h
        ras8dB2:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreVDHSwitchToVPM   MACRO
                        local ras8d33
                        IFDEF   MMIOPH
                        SetupTest32     8dh,ras8d33,8d33h
        ras8d33:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostVDHSwitchToVPM  MACRO
                        local ras8dB3
                        IFDEF   MMIOPH
                        SetupTest32     8dh,ras8dB3,8dB3h
        ras8dB3:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreVDHSwitchToV86   MACRO
                        local ras8d34
                        IFDEF   MMIOPH
                        SetupTest32     8dh,ras8d34,8d34h
        ras8d34:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostVDHSwitchToV86  MACRO
                        local ras8dB4
                        IFDEF   MMIOPH
                        SetupTest32     8dh,ras8dB4,8dB4h
        ras8dB4:
                        ExitMMPH
                        ENDIF
                        ENDM

;****************************************************************************
;
;       EM86IF.ASM
;
;****************************************************************************

MMPHPreVDHSetFlags      MACRO flags
                        local ras8d35
                        IFDEF   MMIOPH
                        SetupTest32     8dh,ras8d35,8d35h
;                       mov     es:[PERF_DATA], 4       ; 4 bytes of data
                        mov     es:[PERF_DATA_4], flags
        ras8d35:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostVDHSetFlags     MACRO
                        local ras8dB5
                        IFDEF   MMIOPH
                        SetupTest32     8dh,ras8dB5,8dB5h
        ras8dB5:
                        ExitMMPH
                        ENDIF
                        ENDM

;****************************************************************************
;
;       EM86INT.ASM
;
;****************************************************************************

MMPHPreVDHPushInt       MACRO vector
                        local ras8d36
                        IFDEF   MMIOPH
                        SetupTest32     8dh,ras8d36,8d36h
;                       mov     es:[PERF_DATA], 4       ; 4 bytes of data
                        mov     es:[PERF_DATA_4], vector
        ras8d36:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostVDHPushInt      MACRO
                        local ras8dB6
                        IFDEF   MMIOPH
                        SetupTest32     8dh,ras8dB6,8dB6h
        ras8dB6:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPreVDHPopInt        MACRO
                        local ras8d37
                        IFDEF   MMIOPH
                        SetupTest32     8dh,ras8d37,8d37h
        ras8d37:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostVDHPopInt       MACRO
                        local ras8dB7
                        IFDEF   MMIOPH
                        SetupTest32     8dh,ras8dB7,8dB7h
        ras8dB7:
                        ExitMMPH
                        ENDIF
                        ENDM

;****************************************************************************
;
;       VPICA.ASM
;
;****************************************************************************

MMPHPreVDHSendVEOI      MACRO hirq
                        local ras8d38
                        IFDEF   MMIOPH
                        SetupTest32     8dh,ras8d38,8d38h
                        mov     es:[PERF_DATA], 4       ; 4 bytes of data
                        mov     es:[PERF_DATA_4], hirq
        ras8d38:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostVDHSendVEOI     MACRO
                        local ras8dB8
                        IFDEF   MMIOPH
                        SetupTest32     8dh,ras8dB8,8dB8h
        ras8dB8:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPrevpicChangeVIRRState      MACRO phvm
                        local ras8d79
                        IFDEF   MMIOPH
                        SetupTest32     8dh,ras8d79,8d79h
                        mov     es:[PERF_DATA], 4       ; 4 bytes of data
                        mov     es:[PERF_DATA_4], phvm
        ras8d79:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostvpicChangeVIRRState     MACRO
                        local ras8dF9
                        IFDEF   MMIOPH
                        SetupTest32     8dh,ras8dF9,8dF9h
        ras8dF9:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPrevpicCheckVIRR    MACRO   phvm
                        local ras8d7A
                        IFDEF   MMIOPH
                        SetupTest32     8dh,ras8d7A,8d7Ah
                        mov     es:[PERF_DATA], 4       ; 4 bytes of data
                        mov     es:[PERF_DATA_4], phvm
        ras8d7A:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostvpicCheckVIRR   MACRO
                        local ras8dFA
                        IFDEF   MMIOPH
                        SetupTest32     8dh,ras8dFA,8dFAh
        ras8dFA:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPrevpicSimulateInt  MACRO
                        local ras8d7B
                        IFDEF   MMIOPH
                        SetupTest32     8dh,ras8d7B,8d7Bh
;                       mov     es:[PERF_DATA], 4       ; 4 bytes of data
;                       mov     es:[PERF_DATA_4], hvdm
        ras8d7B:
                        ExitMMPH
                        ENDIF
                        ENDM

MMPHPostvpicSimulateInt MACRO
                        local ras8dFB
                        IFDEF   MMIOPH
                        SetupTest32     8dh,ras8dFB,8dFBh
        ras8dFB:
                        ExitMMPH
                        ENDIF
                        ENDM

