[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 DosGetSegBase()               Get base address of segment selector.
------------------------------------------------------------------------------

 Function : Get the base address of a segment selector.

 Syntax   : USHORT BLXAPI DosGetSegBase(SEL selector, PULONG baseaddr);

 selector   Unsigned value representing a valid selector number.

 baseaddr   Pointer to a long integer to receive the returned selector base
            address.

 This function returns the linear base address of the selector parameter.

 Example:

    #include <stdlib.h>
    #include <stdio.h>
    #include <string.h>
    #include <blx286.h>
    #define VID_BUF 0xB800
    #define VID_SIZE 0x8000l
    void main (void)
    {
    SEL         video_buffer;
    ULONG       screen_address ;
    /* get selector that corresponds to the screen buffer */
    if (DosMapRealSeg(VID_BUF,VID_SIZE,&video_buffer) != 0)
       {
       printf("Unable to map screen segment\n");
       exit(255);
    }
    printf("Selector for video buffer %04X\n",video_buffer);
    if (DosGetSegBase(video_buffer, &screen_address) == 0)
       printf("Screen base address : %08X\n",screen_address);
    }

This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson