From: Damian Yerrick Newsgroups: comp.os.msdos.djgpp Subject: Re: Casting pointers Organization: Pin Eight Software Message-ID: References: <865adi$tbm$1 AT bird DOT wu-wien DOT ac DOT at> <38863BDF DOT 44 AT erols DOT com> X-Newsreader: Forte Agent 1.7/32.534 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 26 X-Trace: /K+neUtoJjXnlo9nK+8sU712fyhtTpvf3f+KXnYpeQ/FlfXgdH/KOBF9FHLmuHlL3CPg2e7m9gTF!yIfTwCNQu6juF1TMVYmKJldetJFVbJUc3vrgzHohSOAgTsLN1HBuS66JFFzRAW5ltNKCBgIAGw== X-Complaints-To: abuse AT gte DOT net X-Abuse-Info: Please be sure to forward a copy of ALL headers X-Abuse-Info: Otherwise we will be unable to process your complaint properly NNTP-Posting-Date: Thu, 20 Jan 2000 03:22:05 GMT Distribution: world Date: Thu, 20 Jan 2000 03:22:05 GMT To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com "John S. Fine" wrote in message <38863BDF DOT 44 AT erols DOT com>... > There ought to be an (inline) function defined in >some .h file to reverse the bytes in a long, so you >can use longs from MSB sources (data files or network >protocols) in an LSB program. htonl() ntohl() As always, you can get information on any DJGPP symbol with info: C:\>info libc alpha [function-name] An inline assembly implementation might look like this: load number into eax 0123 swap bytes of ax 0132 swap shorts of eax 3201 swap bytes of ax 3210 Or is this already how it works? -- Damian Yerrick http://yerricde.tripod.com/ View full sig at http://www.rose-hulman.edu/~yerricde/sig.html Comment on story ideas at http://home1.gte.net/frodo/quickjot.html And yes, I have set my attribute line to emulate Outhouse Express.