title: Assembly rdtsc x64 ubuntu
body: <p>I'm trying to use rdtsc function but i've got weird numbers. I'm trying to call this function from C code and pass the tick back to function. Can you tell me if im doing it right or not ?</p>
  
  <p>Asm code:</p>
  
  <pre><code>.text
  
  .globl czas
  .type czas, @function
  
  czas:
  pushq %rbp
  movq %rsp, %rbp
  xor %rax,%rax;
  cpuid
  rdtsc
  popq %rbp
  ret
  </code></pre>
  
  <p>C code:</p>
  
  <pre><code>unsigned long long Czas;
  Czas=czas();
  </code></pre>