Date: Thu, 18 Sep 1997 12:03:56 +0300 (IDT) From: Eli Zaretskii To: Alessandro Moure cc: djgpp AT delorie DOT com Subject: Re: Memory address, protected mode, real mode... Arghhhhhhhhhh! In-Reply-To: <34209575.19A4@sercomtel.com.br> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Wed, 17 Sep 1997, Alessandro Moure wrote: > My old code (16 bits) was: > > #define MASK 0xFFFFFFFL > #define BASEADD 0xD0000000L > > for(counter = foo; counter < foo2; counter++) > data[counter] = MASK & *(BASEADD + counter); > > where data[] is float. If data[] is an array of floats, then maybe the ``trash'' you get is how float numbers look like when you treat them as ints? You have said that your DJGPP code is like this: unsigned long data; data = _farpeekl(_dos_ds, 0xD0000 + counter); Here data is an unsigned long, not a float. You need to convert it to a float (e.g., by using a union of unsigned long and a float) to see meaningful data. Did you try this? Another problem is that you advance the offset by one instead of by sizeof(unsigned long). farptr functions don't know about pointer arithmetics, they always treat the offset as a byte offset.