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 msxml 获取 api接口

Delphi 清除字符串两边空格或指定字符

Delphi 2009 之 tcategorypanelgroup[5]: headerstyle

Delphi 蓝牙连接打印机演示

Delphi readprocessmemory 输入进程id 输入读取地址

Delphi基于sobel算子的图像边缘检测

Delphi 不可移动的窗体

Delphi格式化函数format、formatdatetime和formatfloat

Delphi firedac tfddatamove 导出csv

Delphi [函数] unicode 检查字符串是否含中文字

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



打赏

取消

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

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

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

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

评论

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