next up previous contents index
Next: Get_Next_Selector_Increment_Value Up: Functions and Procedures Previous: Free_Ldt_Descriptor

Segment_To_Descriptor

   

Declaration:

Function Segment_To_Descriptor (Seg : Word) : Word;

Description:

Segment_To_Descriptor Maps a real mode segment (paragraph) address (in Seg) onto an descriptor that can be used by a protected mode program to access the same memory.

The function returns a selector to the DOS real-mode segment.

Notes:

Errors:

None.

See also:

Example
uses go32;

var r : trealregs;
    VGAsel : word;

begin
     r.realeax := $13; realintr($10, r); 
     { set VGA mode 13h }
     VGASel := segment_to_descriptor($A000);
     {...}
     seg_fillchar(VGAsel, 100*320+6, 1, 15); 
     { put a pixel at (6/100) in color 15 }
     readln;
     {...} 
     r.realeax := $3; realintr($10, r);
end.



Michael Van Canneyt
Tue Mar 31 16:46:10 CEST 1998