Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Watcom C/C++ User's Guide - a void based pointer must be explicitly combined with a segment value to http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
A void based pointer must be explicitly combined with a segment value to
produce a reference to a memory location.  A void based pointer does not
infer its segment value from another object.  The :> (base) operator is used
to combine a segment value and a void based pointer.

For example, on a personal computer running DOS with a color monitor, the
screen memory begins at segment 0xB800, offset 0.  In a video text mode, to
examine the first character currently displayed on the screen, the following
code could be used:

Example:

     extern void main()
     {
         __segment             screen;
         char __based( void ) *scrptr;

         screen = 0xB800;
         scrptr = 0;
         printf( "Top left character is '%c'.\n",
                 *(screen:>scrptr) );
     }

The general form of the :> operator is:


     segment :> offset

where segment is an expression of type __segment, and offset is an
expression of type __based( void ) *.

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