crol循环移位系列函数使用说明

_crol_ 字符循环左移
_cror_ 字符循环右移
_irol_ 整数循环左移
_iror_ 整数循环右移
_lrol_ 长整数循环左移
_lror_ 长整数循环右移
_cror_
Summary  #include <intrins.h>
unsigned char _cror_ (unsigned char c, unsigned char b); 
      /* character to rotate right */ //循环右移b位
      /* bit positions to rotate *///循环右移的数位
Description  The _cror_ routine函数 rotates the bit pattern for the character c right b bits. This routine is implemented 应用as an intrinsic内部函数 function. 
Return Value  The _cror_ routine returns the rotated value of c. 
See Also  _crol_, _irol_, _iror_, _lrol_, _lror_ 
Example  #include <intrins.h>
void test_cror (void) {
  char a;
  char b;
  a = 0xA5;
  b = _crol_(a,1);  /* b now is 0xD2 */
unsigned char _crol_ (unsigned char c, unsigned char b);// 使无符号字符循环向左移动b位
unsigned char _cror_ (unsigned char c, unsigned char b);// 使无符号字符循环向右移动b位
#include <intrins.h>
unsigned int _irol_ (unsigned int i, unsigned char b); /* integer to rotate left */ /* bit positions to rotate */
    #include <intrins.h>
void test_irol (void) {
  int a;
  int b;
  a = 0xA5A5;
  b = _irol_(a,3);    /* b now is 0x2D2D */
}
#include <intrins.h>
unsigned long _lrol_ (unsigned long l,  unsigned char b); /* 32-bit integer to rotate left */  /*
bit positions to rotate */
  #include <intrins.h>
void test_lrol (void) {
  long a;
  long b;
  a = 0xA5A5A5A5;
  b = _lrol_(a,3); /* b now is 0x2D2D2D2D */
}

本文发布于:2024-09-20 13:55:48,感谢您对本站的认可!

本文链接:https://www.17tex.com/xueshu/822932.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:循环   字符   右移   整数
留言与评论(共有 0 条评论)
   
验证码:
Copyright ©2019-2024 Comsenz Inc.Powered by © 易纺专利技术学习网 豫ICP备2022007602号 豫公网安备41160202000603 站长QQ:729038198 关于我们 投诉建议