title: Provide an example of querying Intel CPU capabilities using Rust's inline assembly
body: <p>I am trying to use inline assembly in Rust. The code I'm including is supposed to query Intel CPU capabilities and right now I just want to get the <code>ebx</code> register state after the system call.</p>
  
  <p>Using an nightly build of Rust compiler (required to use the <code>asm!</code> macro) the code compiles. When I run the program, I get random values for the <code>ebx</code> register and a segmentation fault. I'm pretty sure my <code>asm!</code> macro syntax is just wrong but the documentation of this feature is very weak. Does anyone have any pointers as to what I could improve?</p>
  
  <pre><code>#![feature(asm)]
  fn main() {
      let result: u32;
      unsafe {
          asm!("mov eax, 07H;
                mov ecx, 0;
                cpuid;"
                : "={ebx}"(result)
                :
                : "eax, ebx, ecx, edx"
                : "intel"
          )
      }
      println!("ebx from cpuid is {}", result);
  }
  </code></pre>