Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Mac > Mac Code Warrior > CW10 asm error
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 503 of 536
Post > Topic >>

CW10 asm error

by "Stuart A. Malone" <samalone@[EMAIL PROTECTED] > Dec 7, 2005 at 01:30 PM

In upgrading my project from CW 9.5 to 10.0, I've run into a set of 
seemingly bogus errors compiling a file containing inline assembly.  The 
errors look like:

Error   : 'lbz' is not a struct/union/class member
PalmUserManager.cpp line 116       lbz  r4, iIsProfileUser 

Error   : 'lwz' is not a struct/union/class member
PalmUserManager.cpp line 317       lwz  r4, oUserID 

Error   : 'lwz' is not a struct/union/class member
PalmUserManager.cpp line 347       lwz  r5, iKeyName 

Error   : 'lwz' is not a struct/union/class member
PalmUserManager.cpp line 349       lwz  r7, oValue 

Error   : 'lwz' is not a struct/union/class member
PalmUserManager.cpp line 379       lwz  r5, iKeyName 

Error   : 'mr' is not a struct/union/class member
PalmUserManager.cpp line 381       mr  r12, tv 

The frustrating thing about these errors is that they seem to be on 
random lines of assembly code.  Some functions compile fine, and others 
get errors, with no apparent pattern.  For instance, in the following 
code, the first function compiles fine and the second gets an error:

   OSStatus GetUserNameByID(PalmUserID iUserID, CFStringRef * oUserName)
   {
   #if __MACH__
      static void * tvector = GetFunction("\pUmGetUserNameByID");

      register void * tv = tvector;
      if (tv != 0) {
         register OSStatus result;
         asm {
            .volatile
            lwz      r3, iUserID
            lwz      r4, oUserName
            mr    r12, tv
            lwz      RTOC, 4(tv)
            lwz      r0, 0(tv)
            mtctr r0
            bctrl
            mr    result, r3
         }
         return result;
      }
      else return gLastLibraryError;
   #else
      if (::UmGetUserNameByID == 0) return cfragNoLibraryErr;
      else return ::UmGetUserNameByID(iUserID, oUserName);
   #endif
   }


   OSStatus GetIDFromName(CFStringRef iUserName, PalmUserID * oUserID)
   {
   #if __MACH__
      static void * tvector = GetFunction("\pUmGetIDFromName");

      register void * tv = tvector;
      if (tv != 0) {
         register OSStatus result;
         asm {
            .volatile
            lwz      r3, iUserName
            lwz      r4, oUserID
            mr    r12, tv
            lwz      RTOC, 4(tv)
            lwz      r0, 0(tv)
            mtctr r0
            bctrl
            mr    result, r3
         }
         return result;
      }
      else return gLastLibraryError;
   #else
      if (::UmGetIDFromName == 0) return cfragNoLibraryErr;
      else return ::UmGetIDFromName(iUserName, oUserID);
   #endif
   }

I've checked the source files for invisible characters that might be 
causing the problem, and can't find any.  Any clues as to what's going 
wrong here, and how to work around it?


Thanks,

--Stuart A. Malone
  Llamagraphics, Inc.
 




 1 Posts in Topic:
CW10 asm error
"Stuart A. Malone&qu  2005-12-07 13:30:27 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Jul 9 7:59:00 CDT 2008.