dpmi.inc 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. {
  2. $Id$
  3. This file is part of the Free Pascal run time library.
  4. Copyright (c) 1999-2000 by the Free Pascal development team
  5. See the file COPYING.FPC, included in this distribution,
  6. for details about the copyright.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10. **********************************************************************}
  11. TYPE
  12. TDPMIRegisters = record
  13. EDI, ESI, EBP, Reserved, EBX, EDX, ECX, EAX : longint;
  14. Flags, ES, DS, FS, GS, IP, CS, SP, SS : word;
  15. end;
  16. Procedure RealIntr(IntNo : word; var Regs:TDPMIRegisters); assembler;
  17. (*********************************************************************)
  18. (* PROCEDURE RealModeInt(IntNo: word; Var Regs: TDPMIRegisters) *)
  19. (* Calls the DPMI server to switch to real mode and call the *)
  20. (* real mode interrupt. ALL MEMORY REGISTERS (if used) SHOULD *)
  21. (* contain REAL MODE ADRESSES! *)
  22. (* IntNo -> Real mode interrupt to call (0-255) *)
  23. (* Regs -> Registers to pass on to interrupt. *)
  24. (* (ALL UNUSED REGISTERS SHOULD BE SET TO 0 ON ENTRY!) *)
  25. (*********************************************************************)
  26. asm
  27. PUSH BP { Save BP, just in case }
  28. MOV BX,IntNo { Move the Interrupt number into BX }
  29. XOR CX,CX { Clear CX }
  30. LES DI,Regs { Load the registers into ES:DI }
  31. MOV AX,$300 { Set function number to 300h }
  32. INT $31 { Call Interrupt 31h - DPMI Services }
  33. JC @Exit { Jump to exit on carry }
  34. XOR AX,AX { Clear AX }
  35. @Exit: { Exit label }
  36. POP BP { Restore BP }
  37. end;
  38. {
  39. $Log$
  40. Revision 1.4 2000-02-09 16:59:28 peter
  41. * truncated log
  42. Revision 1.3 2000/01/07 16:41:31 daniel
  43. * copyright 2000
  44. Revision 1.2 2000/01/07 16:32:23 daniel
  45. * copyright 2000 added
  46. Revision 1.1 1999/11/08 11:15:21 peter
  47. * move graph.inc to the target dir
  48. }