[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
BLIPTRINC() Huge pointer increment
------------------------------------------------------------------------------
Function : Huge pointer increment
Syntax : BLIPTRINC(pointer, nlvalue)
Return : Incremented pointer
Some C/C++ compilers generate code using huge protected mode pointers quite
happily (such as Borland C++ in most cases), while others generate
references to __AHSHIFT and __AHINCR. These symbols are used to advance huge
pointers over segment boundaries, and are provided in the compiler runtime
library as constants that work correctly in real mode only. As it is
impossible for Blinker to provide single values for these constants that
will work in both real mode and protected mode, there are two possible
solutions:
1) BLXSHFPT.OBJ or BLXSHFTR.OBJ can be linked as a FILE to resolve these
symbols with protected mode or real mode compatible values respectively, but
the resulting .EXE will ONLY run correctly IN PROTECTED MODE as the
increments are hard coded for protected mode.
2) The code can be updated to use two Blinker functions BLIPTRINC() and
BLIPTRDEC() to advance the pointers correctly in all modes, including dual
mode.
For example if BLOCK is some complex type then :
1 memptr = (BLOCK huge *) halloc ((long) BLKMAX,sizeof (BLOCK));
2 if (memptr)
3 {
4 tmpptr = memptr;
5 for (i = 0; i < BLKMAX; i++)
6 {
7 ... /* Some operation */
8 tmpptr++; Borland handles huge pointers ok */
9 }
10 }
Line 8 can be replaced with
tmpptr = BLIPTRINC (tmpptr, (long) sizeof (BLOCK));
See Also:
BLIPTRDEC()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson