home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!munnari.oz.au!uniwa!DIALix!acix!johnv
- From: johnv@acix.DIALix.oz.au (John Verhoeven)
- Subject: Help with shifts in Manx C
- Newsgroups: comp.sys.amiga.programmer
- Summary: Manx Aztec C Shift operators
- X-Newsreader: TIN [version 1.1 PL8]
- Message-ID: <johnv.041s@acix.DIALix.oz.au>
- Date: 6 Jan 93 14:04:39 WST
- Organization: ACix - Private UUCP Node, Cloverdale, Western Australia.
- Lines: 24
-
- I been playing with the AllocEntry() function.
-
- The latest RKM Libraries (pp 460) have this example for checking the return
- from AllocEntry (where memlist is assigned the return from AllocEntry):
-
- #define ALLOCERROR 0x80000000
-
- if ((ULONG)memlist & ALLOCERROR)
- {
- /* a problem...do something */
- }
-
- When I compile this with Aztec C68k/Amiga 5.2a Sep 25 1991 17:04:29 it
- translates the code to the instruction btst.b #7,memlist which is
- incorrect.
-
- I've tried using "if (memlist & (1L<<31))" with the same result.
-
- If I declare ALLOCERROR as a ULONG equal to 0x80000000 it uses the
- instruction and.l memlist,ALLOCERROR which is correct.
-
- So shouldn't Manx convert the "if (memlist & (1L<<31))" to the instruction
- sequence of moveq #31,d0 followed by btst.l d0,memlist?
-
-