Jump to content
  • Advertisement
Sign in to follow this  
_Sigma

LOBYTE

This topic is 3911 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I want to do this: //edit don't worry about the hardcoded values, its just to make the example code easier to understand.
  int NameLen; 
  int Temp1; 
  signed int NameResult; 
  signed int NameCounter; 
  char* Name = "_Sigma";

     NameCounter = 6;
     NameResult = 0;
     Temp1 = 0;

     do
     {
         //change the lowbyte in temp1 to be the character from name
         LOBYTE(Temp1) = Name[NameCounter];
         NameResult += Temp1 + 85;
         --NameCounter;
     }
     while ( NameCounter );


However, the compiler informs me that this is forbidden under ISO standards. How do I achieve this?

Share this post


Link to post
Share on other sites
Advertisement
If you only want to change the low byte and not any other part of Temp1 and you know that Name[NameCounter] is zero everywhere outside of the low byte, then you can just do

Temp1 |= Name[NameCounter];

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!