[comp.sys.ibm.pc] Far pointers in MSC

rfarris@serene.UUCP (Rick Farris) (12/13/88)

In article <10690@s.ms.uky.edu> simon@ms.uky.edu (Simon Gales) writes:
>In article <464@octopus.UUCP> pete@octopus.UUCP (Pete Holzmann) writes:
>>
>>unsigned far *lpts = 0x00400008L;  /* Define a pointer to the LPT ports */
>
>should be:
>
>unsigned far *lpts = 0x00000408L;  /* Addr = Segment * 16 + Offset */


Either one works just fine.  The MSC compiler splits the value down
the middle, and loads the upper four digits into a segment register
and the lower four digits into an offset register.

Pete's method yields:

                0040    segment
                 0008   offset
              --------
                00408	physical address

Your method yields:

		0000	segment
		 0408	offset
	       -------
	        00408	physical address

Both are exactly the same.  Before you claim otherwise, do a simple
experiment, ok?
-- 
Rick Farris   RF Engineering  POB M  Del Mar, CA  92014   voice (619) 259-6793
rfarris@serene.cts.com     ...!uunet!serene!rfarris       serene.UUCP 259-7757