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 webbrowser 使滚动条滚动到底部

Delphi获取ie路径

Delphi 获取程序自身大小的函数

Delphi 使richedit中的链接可以点击

Delphi 用iisreset命令重启iis

Delphi用ado操作数据库完整示例

Delphi 系统长文件名与dos形式短文件名的相互转换

Delphi firedac 下的 sqlite [1] - 前言

Delphi adoconnection1 连接excel表格读取数据

Delphi renamefile 文件改名

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



打赏

取消

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

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

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

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

评论

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