Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

Documentation for RTM.EXE (16-Bit) from Borland (Developers)

posted by fm77, 04.05.2012, 11:42

> > One more question (sorry): I didn't try it but, if I used your HX DOS
> > Extender with the Delphi V1 command line compiler DCC.EXE (16-Bit) it might
> > not work since it uses for example RTM.46 - I don't even have a name for
> > that function.
>
> I also have no idea what this is supposed to do.

Just for completeness, I found the definition of the function RTM.46 in the newsgroup:

Dmitry Dmitrienko wrote on May 05, 1997 in comp.lang.pascal.borland

> There are no problems if you use protected mode and write using DPMI
> target of BP. E.g. you can use RTM entry point i've 'discovered'
> tree years ago:

function MemAllocateBigBlock(HeapHandle: Word; Size: LongInt;
  Flags: Word; EventProc: Pointer; var Selector: Word): Integer; far;
  external 'RTM' index $002E;

function MemFreeBlock(Selector: Word): Integer; far;
  external 'RTM' index $0006;

> Usually, i'm using this functions in following manner:

var
  Selector1M: Word;
  Size: Longint;
begin
  Size:=1024 * 1024;
  if MemAllocateBigblock(0, Size, 4, nil, Selector1M) = 0
  then begin
    {allocated ok}
    SetSelectorLimit(Selector1M,Size-1);
  end
  else begin
    {function failed}
  end;
{ use this memory block }
{ free memory block}
  MemFreeBlock(Selector1M);
end;

> where procedure SetSelectorLimit looks like:

procedure SetSelectorLimit(Sel: Word; Limit: Longint);
begin
  if Limit > 1024 * 1024 then { page-align needed }
  begin
    Limit:=(Limit + $FFF) and NOT $FFF;
  end;
  asm
        mov     ax,8 { set selector limit}
        mov     bx,Sel
        mov     cx,word ptr Limit[2]
        mov     dx,word ptr Limit[0]
        int     31h
  end;
end;

I believe Dmitry Dmitrienko can be reached through http://www.php-debugger.com/resume/, but I am not quite sure.

I am reposting this here because it seems to me that the information in the newsgroups are disappearing over time.

Comparing RTM.46 (MemAllocateBigBlock) with RTM.5 (MemAllocateBlock) it looks reasonable:

function MemAllocateBigBlock(HeapHandle: Word; Size: LongInt; Flags: Word;
  EventProc: Pointer; var Selector: Word): Integer; far;
  external 'RTM' index $002E;

function MemAllocateBlock(HeapHandle, Size, Attributes: Word;
  EventProc: Pointer; var Selector: Word): Integer; far;
  external 'RTM' index $0005;

Hope someone will find that usefull.

BTW: Searching or browsing the newsgroups with google is getting worse every day - why?

---
I am still so much in love with Borland Pascal Version 7.0

 

Complete thread:

Back to the forum
Board view  Mix view
22762 Postings in 2122 Threads, 402 registered users (0 online)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum