-
Notifications
You must be signed in to change notification settings - Fork 1
/
ems.hpp
executable file
·40 lines (36 loc) · 1015 Bytes
/
ems.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#ifndef EMS_HPP
#define EMS_HPP
# include <dos.h>
//these globals are used throughout the program
const unsigned EMSInt = 0x67 ;
const unsigned PageSize = 0x4000 ;
// first define an often used inline function
inline unsigned EMSCall(unsigned EMSCallNum , REGS & reg)
{
reg.h.ah = EMSCallNum ;
int86(EMSInt,®,®) ;
return (unsigned)reg.h.ah ;
}
// prototype declarations for the EMS package
void far * EMSPresent() ;
void far * EMSSlotAddr(unsigned SlotNum) ;
unsigned EMSStatus() ;
unsigned EMSPageCount() ;
// the EMS class definition
class EMS {
friend void far * EMSPresent() ;
friend void far * EMSSlotAddr(unsigned) ;
private :
unsigned handle ;
unsigned noPages ;
public :
static unsigned frameSegment ;
// allocate and unallocate the EMS handle
EMS(unsigned PageCount) ;
~EMS() ;
//map the memory area in
unsigned map(unsigned page,unsigned frameSlot) ;
//check an object's status
unsigned status() ;
} ;
#endif