This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

swap equivelant.

Hi,

Is there an equivelan function or keyword to "swap"? Is there anyway to get the high or lower nibbles of a variable or swap them in C? any help would be appreciated.

-=N

Parents
  • All that would be required is for C51 to detect a special case of the intrinsic function _crol_() when the number of bits to roll is known to be four. e.g.

    	c = _crol_(c, 4);
    
    C51 could then simply use a SWAP. In fact C51 could roll by any number of know bits by simply using a combination of SWAP and no more than two RL or RR instructions.

Reply
  • All that would be required is for C51 to detect a special case of the intrinsic function _crol_() when the number of bits to roll is known to be four. e.g.

    	c = _crol_(c, 4);
    
    C51 could then simply use a SWAP. In fact C51 could roll by any number of know bits by simply using a combination of SWAP and no more than two RL or RR instructions.

Children