Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!mips!atha!aunro!alberta!ubc-cs!soph.cs.ubc.ca!b2676870 From: b2676870@soph.cs.ubc.ca (George Chow) Newsgroups: comp.sys.handhelds Subject: What's the difference? Keywords: SAME, ==, binary integer Message-ID: <1991Jun26.180439.6856@soph.cs.ubc.ca> Date: 26 Jun 91 18:04:39 GMT Sender: news@soph.cs.ubc.ca (Usenet News) Followup-To: comp.sys.handhelds Organization: Soph Lab, CPSC, UBC, Vancouver, B.C., Canada Lines: 16 Originator: b2676870@eutsuk.soph.cs.ubc.ca I've ran across a curious behaviour that I can't explain. I've RTFM and I still can't see why. Consider the following fragment: # 80000000 h SRB SRB SRB # C0 h AND # 80 h SAME With word size > 32, the above evaluates to 1 (as expected). However, with word size = 32, the above evalutes to 0. Why is this the case? As I recall, the 48's binary integer are unsigned so there's no hidden sign extension. And I'm using shifts, not rotates. The above fragment came up as a problem case for a quickie program I wrote to decode IP addresses. George