dpmi.inc 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. {
  2. $Id$
  3. This file is part of the Free Pascal run time library.
  4. Copyright (c) 1993,99 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.2 1999-07-12 13:27:10 jonas
  41. + added Log and Id tags
  42. * added first FPC support, only VGA works to some extend for now
  43. * use -dasmgraph to use assembler routines, otherwise Pascal
  44. equivalents are used
  45. * use -dsupportVESA to support VESA (crashes under FPC for now)
  46. * only dispose vesainfo at closegrph if a vesa card was detected
  47. * changed int32 to longint (int32 is not declared under FPC)
  48. * changed the declaration of almost every procedure in graph.inc to
  49. "far;" becquse otherwise you can't assign them to procvars under TP
  50. real mode (but unexplainable "data segnment too large" errors prevent
  51. it from working under real mode anyway)
  52. }