home *** CD-ROM | disk | FTP | other *** search
- /* ==( dos/pregs.h )== */
-
- /* ----------------------------------------------- */
- /* Pro-C - Copyright (C) 1988, 1989 Vestronix Inc. */
- /* Modification to this source is not supported */
- /* by Vestronix Inc. */
- /* All Rights Reserved */
- /* ----------------------------------------------- */
- /* Written Geo 26-Aug-88 */
- /* Modified Geo 25-Oct-89 See comments below */
- /* ----------------------------------------------- */
- /* %W% (%H% %T%) */
-
- /*
- * Modifications
- *
- * 25-Oct-89 Geo - 1.32 Merge
- *
- *
- */
-
- /*
- * Simple defines to allow TurboC's
- * pseudo variables to be used instead
- * of the slower int86
- *
- * Warning - Know what you are doing !
- * The pseudo registers need to be copied
- * to real variables after the interrut call
- * as they are not guarranted
- *
- * V2.0 TurboC and MSC 5.1 only supported for segment extras
- */
-
- # undef __TURBOC__
-
- # ifdef __TURBOC__
- /* Storage requirements */
- # define RegStorage
- # define SegStorage
- /* word registers */
- # define Regs_ax _AX
- # define Regs_bx _BX
- # define Regs_cx _CX
- # define Regs_dx _DX
- # define Regs_si _SI
- # define Regs_di _DI
- /* byte registers */
- # define Regs_al _AL
- # define Regs_ah _AH
- # define Regs_bl _BL
- # define Regs_bh _BH
- # define Regs_cl _CL
- # define Regs_ch _CH
- # define Regs_dl _DL
- # define Regs_dh _DH
- /* Segment registers */
- # define Segs_es _ES
- # define Segs_cs _CS
- # define Segs_ss _SS
- # define Segs_ds _DS
- /* Carry flag register (Not all CC have this) */
- # define Regs_cf (_FLAGS & 1)
- /* Interrupt calls */
- /* Default segments */
- # define CallInt(n) __int__(n)
- # define Video() CallInt(0x10)
- # define Floppy() CallInt(0x13)
- # define Keyboard() CallInt(0x16)
- # define Bios() CallInt(0x21)
- # define Mouse() CallInt(0x33)
-
- /* Defined segments */
- # define Videox() CallInt(0x10)
- # define Floppyx() CallInt(0x13)
- # define Keyboardx() CallInt(0x16)
- # define Biosx() CallInt(0x21)
- # define Mousex() CallInt(0x33)
-
- # else /* MSC etc */
-
- /* Storage requirements */
- # define RegStorage union REGS regs
- # define SegStorage struct SREGS sregs
- /* word registers */
- # define Regs_ax regs.x.ax
- # define Regs_bx regs.x.bx
- # define Regs_cx regs.x.cx
- # define Regs_dx regs.x.dx
- # define Regs_si regs.x.si
- # define Regs_di regs.x.dx
- /* byte registers */
- # define Regs_al regs.h.al
- # define Regs_ah regs.h.ah
- # define Regs_bl regs.h.bl
- # define Regs_bh regs.h.bh
- # define Regs_cl regs.h.cl
- # define Regs_ch regs.h.ch
- # define Regs_dl regs.h.dl
- # define Regs_dh regs.h.dh
- /* Segment registers */
- # define Segs_es sregs.es
- # define Segs_cs sregs.cs
- # define Segs_ss sregs.ss
- # define Segs_ds sregs.ds
- /* Carry flag register (Not all CC have this) */
- # define Regs_cf regs.x.cflag
- /* Interrupt calls */
- /* Default segments */
- # define CallInt(n) int86(n, ®s, ®s)
- # define Video() CallInt(0x10)
- # define Floppy() CallInt(0x13)
- # define Keyboard() CallInt(0x16)
- # define Bios() CallInt(0x21)
- # define Mouse() CallInt(0x33)
-
- /* Defined segments */
- # define CallIntx(n) int86x(n, ®s, ®s, &sregs)
- # define Videox() CallIntx(0x10)
- # define Floppyx() CallIntx(0x13)
- # define Keyboardx() CallIntx(0x16)
- # define Biosx() CallIntx(0x21)
- # define Mousex() CallInt(0x33)
- # endif
-