home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / amiga / programm / 18203 < prev    next >
Encoding:
Internet Message Format  |  1993-01-06  |  1.1 KB

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