2
0

dpmi.inc 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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.3 2000-01-07 16:41:31 daniel
  41. * copyright 2000
  42. Revision 1.2 2000/01/07 16:32:23 daniel
  43. * copyright 2000 added
  44. Revision 1.1 1999/11/08 11:15:21 peter
  45. * move graph.inc to the target dir
  46. Revision 1.2 1999/07/12 13:27:10 jonas
  47. + added Log and Id tags
  48. * added first FPC support, only VGA works to some extend for now
  49. * use -dasmgraph to use assembler routines, otherwise Pascal
  50. equivalents are used
  51. * use -dsupportVESA to support VESA (crashes under FPC for now)
  52. * only dispose vesainfo at closegrph if a vesa card was detected
  53. * changed int32 to longint (int32 is not declared under FPC)
  54. * changed the declaration of almost every procedure in graph.inc to
  55. "far;" becquse otherwise you can't assign them to procvars under TP
  56. real mode (but unexplainable "data segnment too large" errors prevent
  57. it from working under real mode anyway)
  58. }