Source file: /~heha/messtech/motor.zip/VXDSRC/MPK3D.C

#include "mpk3d.h"

/* Universelle VxD-Aufrufroutinen */
byte VxDsupC(byte AFunc, byte AUnit, long lParam1, long lParam2){
 asm{
  mov al,[AUnit]
  mov ah,[AFunc]
  db 0x66; mov dx,word ptr [lParam1]
  db 0x66; mov cx,word ptr [lParam2]
  db 0x66; cmp word ptr [EntryPoint],0
  jz @@1
  call [EntryPoint]
@@1:
 }
 return _AL;
}

byte VxDsupV(byte AFunc, byte AUnit, long *lParam1, long *lParam2){
 asm{
  mov al,[AUnit]
  mov ah,[AFunc]
  les bx,[lParam1]
  db 0x66; mov dx,es:[bx]
  les bx,[lParam2]
  db 0x66; mov cx,es:[bx]
  db 0x66; cmp word ptr [EntryPoint],0
  jz @@1
  call [EntryPoint]
@@1:
  les bx,[lParam1]
  db 0x66; mov es:[bx],dx
  les bx,[lParam2]
  db 0x66; mov es:[bx],cx
 }
 return _AL;
}

/* Initialisierung: Pointer ermitteln */
void VxDInit(void){
 asm{
  mov bx,MPK3D_Device_ID
  xor di,di
  mov es,di				/* also mit Null laden */
  mov ax,0x1684
  int 0x2f
  mov word ptr [EntryPoint],di
  mov word ptr [EntryPoint+2],es	/* Einsprungadresse zum VxD */
 }
}
Detected encoding: ASCII (7 bit)2