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;

相关阅读 >>

Delphi tlog 日志

Delphi 将鼠标锁定在一定范围

Delphi使用mcisendstring播放背景音��

Delphi andorid应用程序检查wifi有效还是无效

Delphi调用sql分页存储过程实例

Delphi 利用tcomm组件 spcomm 实现串行通信

Delphi datasnap使用ipv6

Delphi 十进制十六进制转换

Delphi console程序中一种定时方法

Delphi richedit 的scrollbar自动向下滚动

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



打赏

取消

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

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

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

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

评论

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

    暂无评论...