<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>TAKEmaru</author_name>
  <author_url>https://blog.hatena.ne.jp/TAKEmaru/</author_url>
  <blog_title>冬のソフトウェア海岸</blog_title>
  <blog_url>https://tkmr.hatenablog.com/</blog_url>
  <categories>
    <anon>asm</anon>
  </categories>
  <description>文字列の長さを算出 以下のasmコード(x64)で、文字列の長さを取得することができる。 mov eax, 0x0 mov rcx, 0xffffffffffffffff repnz scas al, BYTE PTR es:[rdi] not rcx lea rcx, [rcx - 1] // dec rcxでも可x86がいい人は適宜読みかえて欲しい。 解説 repnz/repneはcmps、 scas命令に付加されるプリフィックスで、(r,e)cxレジスタをカウンタとして使用し、カウンタが0になるか ZFフラグが1になるまで繰り返すというものである。repeat not zeroと読めば覚…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftkmr.hatenablog.com%2Fentry%2F2015%2F08%2F29%2F221315&quot; title=&quot;asmでスマートに文字列の長さを算出する - 冬のソフトウェア海岸&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2015-08-29 22:13:15</published>
  <title>asmでスマートに文字列の長さを算出する</title>
  <type>rich</type>
  <url>https://tkmr.hatenablog.com/entry/2015/08/29/221315</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
