home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Equalizer BBS
/
equalizer-bbs-collection_2004.zip
/
equalizer-bbs-collection
/
DEMOSCENE-STUFF
/
BM9.ZIP
/
EMS.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1994-11-23
|
2KB
|
98 lines
Unit Ems;
interface
Procedure Init_ems(pages_needed:Word);
Procedure Alloc_ems(page:Word);
Procedure Page_ems(physical:Byte;logical:Word);
Procedure Alloc_ems64k(page:Word);
Function All_ems:Word;
Function Free_ems:Word;
Procedure Close_ems;
var ems_handle,EMSBase:Word;
error:Shortint;
implementation
uses Dos;
Function All_ems:Word;assembler;
asm
mov ah,$42
int $67
mov error,ah
mov ax,dx
end;
Function free_ems:Word;assembler;
asm
mov ah,$42
int $67
mov error,ah
mov ax,bx
end;
Procedure Alloc_ems(page:word);assembler;
asm
mov ah,$44
mov al,0
mov bx,page
mov dx,ems_handle
int $67
mov error,ah
end;
Procedure Page_ems(physical:Byte;logical:Word);assembler;
asm
mov ah,$44
mov al,physical
mov bx,logical
mov dx,ems_handle
int $67
mov error,ah
end;
Procedure Alloc_ems64k(page:Word);assembler;
asm
mov cx,4
mov al,0
mov bx,page
@schl:
mov ah,$44
mov dx,ems_handle
int $67
inc al
inc bx
loop @schl
end;
Procedure Init_ems(pages_needed:Word);assembler;
asm
mov ah,$43
mov bx,pages_needed
int $67
mov ems_handle,dx
mov error,ah
cmp error,0
jne @ende
{---------}
mov ah,$41
int $67
mov EMSBase,bx
mov error,ah
@Ende:
end;
Procedure Close_ems;assembler;
asm
mov ah,$45
mov dx,Ems_handle
int $67
mov error,ah
end;
begin
error:=0;
end.