0

'我从 HLA 世界开始,我正在尝试编译示例 CallingHLA,然后 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( "_ExitProcess@4" );

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( "0123456789abcdefghijklmnop", 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 中),但是,我该如何解决该错误?谢谢

4

1 回答 1

1

问题是printExceptionError,它应该是这样的:

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

因此,正如错误所说,您缺少参数。

于 2013-05-04T15:29:52.173 回答