[comp.os.msdos.programmer] Near & far in QuickC/MSC

chan@cup.portal.com (Jeffrey Weylor Chan) (06/30/91)

I'm using QuickC 2.5, but this problem should be one most of you 
have seen due to segmented memory of the x86.  The question is:
how do you get information across the memory segments?

From the pretty good description in the books supplied with QC, the 
difference between near and far pointers and variables is that near 
addresses are 16 bit only (and cannot cross segment boundaraies), 
whereas far addresses are 32 bit (segment & offset).  The problem
to me seems that if you declare one variable (or pointer) to be 
near and another to be far that the same operator cannot "see"
both since they use different addressing.  So how are you supposed
to copy data across segments?

(I suppose one solution would be to declare "far" every variable that 
talks to a far variable, but this would obviously be less efficient.
BTW, the reason for the hassle with far is because I'm trying to use
the pressentation graphics library which has far declarations.)

Please mail any help to chan@corp.portal.com as I don't 
regularly read this group.

Thanks,
Jeff C.