Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Blinker 5.10 Online Reference - <b> dosgetsegbase()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 DosGetSegBase()
------------------------------------------------------------------------------
 Purpose:
 Get the base address of a segment selector.

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

 Parameters:
 selector  Unsigned value representing a valid selector number.
 baseaddr  Pointer to a long integer to receive the returned selector
           base address.

 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);                   
 }                                                                           

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson