Date: Thu, 16 May 1996 08:22:46 +0200 (IST) From: Eli Zaretskii To: Jan Louwerens Cc: djgpp AT delorie DOT com Subject: Re: Q: How to handle 64k segments? In-Reply-To: <4nd9db$k66@waldorf.csc.calpoly.edu> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On 15 May 1996, Jan Louwerens wrote: > : I have the following question concerning DJGPP (v1.12mt5 and v2): > : What must I do to copy a 64k segment (starting at DC000) into > : an array with the size of [256][256]. > > I believe DJGPP runs in protected mode with 32 bit segments, not 16 bit. > Just try dereferencing pointers to copy the whole 64k. > for (Index = 0; Index < 65536; Index++) { > *(Dest + Index) = *(Source + Index); > } Please don't post untested code without at least saying so. The above won't work: you can't dereference an absolute address such as 0xdc000 without a triggering protection violation.