本文整理自网络,侵删。
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, eaxend;
相关阅读 >>
Delphi andorid应用程序检查wifi有效还是无效
Delphi 利用tcomm组件 spcomm 实现串行通信
Delphi richedit 的scrollbar自动向下滚动
更多相关阅读请进入《Delphi》频道 >>