2012-10-13 45 views
0

「M開始在HLA世界,我試圖編譯示例,CallingHLA和HLA編譯代碼,我收到以下錯誤:HLA例如調用錯誤

Error in file "hlaFunc.hla" at line 76 [errid:82229/hlaparse.bsn]: 
Too few actual parameters. 
Near: <<) >> 

HLAPARSE assembly failed with 1 errors 

代碼:

unit hlaFuncUnit; 

#include("stdlib.hhf") 

procedure hlaFunc(i:int32); @cdecl; @external("_hlaFunc"); 

procedure BuildExcepts; @external("BuildExcepts__hla_"); 
procedure HardwareException; @external("HardwareException__hla_"); 
procedure DefaultExceptionHandler; @external("DefaultExceptionHandler__hla_"); 

procedure HWexcept; @external("HWexcept__hla_"); 
procedure DfltExHndlr; @external("DfltExHndlr__hla_"); 
procedure QuitMain; @external("QuitMain__hla_"); 

procedure ExitProcess(rtnCode:dword); @external("[email protected]"); 

static 
    MainPgmVMT: dword:= &QuitMain; 

    MainPgmCoroutine: dword[ 5 ]; @external("MainPgmCoroutine__hla_"); 
    MainPgmCoroutine: dword; @nostorage; 
         dword &MainPgmVMT, 0, 0; 
    SaveSEHPointer:  dword; @nostorage; // Still part of MainPgmCoroutine... 
         dword 0, 0; 

procedure QuitMain; 
begin QuitMain; 

    ExitProcess(1); 

end QuitMain; 

procedure HWexcept; 
begin HWexcept; 

    jmp HardwareException; 

end HWexcept; 

procedure DfltExHndlr; 
begin DfltExHndlr; 

    jmp DefaultExceptionHandler; 

end DfltExHndlr; 

procedure hlaFunc(i:int32); 
var 
    s:string; 

begin hlaFunc; 

    call BuildExcepts; 

    try 

     stdout.put("stdout.put called from HLA code, i = ", i, nl); 
     raise(5); 

     exception(5); 
     stdout.put("Exception handled by HLA code" nl); 

    endtry; 

    try 
     stralloc(16); 
     mov(eax, s); 
     str.cpy("Hello World", s); 
     stdout.put("Successfully copied 'Hello World' to s: ", s, nl); 
     str.cpy("abcdefghijklmnop", s); 
     stdout.put("Shouldn't get here" nl); 

     anyexception 

     stdout.put("Exception code: ", eax, nl); 
     ex.printExceptionError(); 

    endtry; 
    strfree(s); 
    stdout.put("Returning to C code" nl); 

    mov(SaveSEHPointer, eax); 

    #asm 
     mov fs:[0], eax 
    #endasm 

end hlaFunc; 

end hlaFuncUnit; 

哪裏埃羅(我知道,錯誤是在TRY),但是,我怎麼能解決這個錯誤? 感謝

回答

1

的問題是printExceptionError,它應該是這樣的:

ex.printExceptionError(eax, ebx, ecx, edx, edi); 

所以,作爲錯誤說,你缺少的參數。