title: Assembly Prototype instruction
body: <p>I am writing an assignment in MASM32 Assembly and I almost completed it but I have 2 questions I can't seem to answer. First, when I compile I get the message:</p>
  
  <blockquote>
    <p>INVOKE requires prototype for
    procedure</p>
  </blockquote>
  
  <p>&amp; </p>
  
  <blockquote>
    <p>invalid instruction operands</p>
  </blockquote>
  
  <p>the first is due to this piece of code:</p>
  
  <pre><code>.data?
  Freq    DWORD ?
  Time1   DWORD ?
  Time2   DWORD ?
  
  .code
  start:
  invoke QueryPerformanceFrequency, addr Freq
  invoke QueryPerformanceCounter, addr Time1 
  </code></pre>
  
  <p>now, I know that </p>
  
  <blockquote>
    <p>The INVOKE directive must be preceded
    by a PROTO statement for the procedure
    being called.</p>
  </blockquote>
  
  <p>but even though I found out the syntax for the PROTO statement:</p>
  
  <pre><code>label PROTO [distance] [langtype] [,[parameter]:tag]
  </code></pre>
  
  <p>I don't understand exactly what I should write so as to make it work and I don't even know what is causing the second error or how to fix it...=/</p>
  
  <hr>
  
  <p><strong>Edit</strong></p>
  
  <p>I already have those libraries and these also:</p>
  
  <pre><code>.386
  .model flat, stdcall
  option casemap :none
  
  include \masm32\include\windows.inc
  include \masm32\include\kernel32.inc
  include \masm32\include\masm32.inc
  includelib \masm32\lib\kernel32.lib
  includelib \masm32\lib\masm32.lib
  </code></pre>
  
  <p>I'm working under Windows Vista just in case that helps as well.</p>
  
  <hr>
  
  <p><strong>Edit 2</strong></p>
  
  <p>If I write the Freq :QWORD after the .data I get this error message:</p>
  
  <blockquote>
    <p>use of register assumed to ERROR</p>
  </blockquote>
  
  <p>and also where should I add the </p>
  
  <pre><code>QueryPerformanceCounter PROTO :DWORD
  </code></pre>
  
  <p>Which as far as I know didn't make an error but still I'm not sure changed anything (I placed it before .data and after the libraries).</p>