delphi StrLenWide 汇编统计字符串长度


本文整理自网络,侵删。

 
function StrLenWide(const Str: PWideChar): Cardinal;
asm
  {Check the first byte}
  cmp word ptr [eax], 0
  je @ZeroLength
  {Get the negative of the string start in edx}
  mov edx, eax
  neg edx
@ScanLoop:
  mov cx, [eax]
  add eax, 2
  test cx, cx
  jnz @ScanLoop
  lea eax, [eax + edx - 2]
  shr eax, 1
  ret
@ZeroLength:
  xor eax, eax
end;

相关阅读 >>

Delphi2010中Delphi class explorer妙用

Delphi 2009 之 tedit 加强的功能

Delphi 判断字符串是否包含汉字,正则版和非正则版

Delphi实现win10下Delphi 10.3.1 inline hook 调试器法获取寄存器并修改

Delphi xe strpas 遇到的问题

Delphi yearof 根据指定的日期返回年

Delphi 生成全球唯一标识符

Delphi 有关debughook

Delphi 实现窗体随着鼠标移动

Delphi中判断是否是64位操作系统

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...