News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Strange error message

Started by Daos, April 03, 2005, 08:36:08 PM

Previous topic - Next topic

Daos

Hi i'm very new to HLA and i was wondering why when i compile this short code(this was bigger but i stripped it so i highlight the error)


program testGetxy;

#include( "stdlib.hhf" );
#include( "console.hhf" );



var

    x:uns32;

    y:uns32;



begin testGetxy;



   

   

    console.getX();

    mov( eax, x );//line 24

end testGetxy;




error on line 24  expected : encountered ( 
Possible undefined ID .getX

ThX a lot!

Sevag.K

Okay, a few things you need:

This function you use are Windows specific so they are not included in the standard hlalib.lib (to maintain compatibility with Linux.

If you want these, you have to link with wincons.lib
The one that ships with hla may not be complete, so use the attached wincons.lib

Another problem is including console.hhf... you have to include "win32cons.hhf" and doing so, you may not also include "stdlib.hhf" or "console.hhf" both of which will exclude "win32cons.hhf"


program testGetxy;

/*

compile:
hla testGetxy wincons.lib

*/

#include( "win32cons.hhf" );

var

    x:uns32;

    y:uns32;



begin testGetxy;


    win32cons.getX();

    mov( eax, x );//line 24

end testGetxy;




[attachment deleted by admin]

Sevag.K

Slight correction to my statement above.

If you want to use "stdlib.hhf" you may include it on a line *after* "win32cons.hhf"
eg:

#include ("win32cons.hhf")
#include ("stdlib.hhf")


Sultan

Quote from: Sevag.K on April 03, 2005, 10:07:00 PM
Slight correction to my statement above.

If you want to use "stdlib.hhf" you may include it on a line *after* "win32cons.hhf"
eg:

#include ("win32cons.hhf")
#include ("stdlib.hhf")



Where can I get Win32cons.hhf ?

I just have win32.hhf
and console.hhf

I ´m also in the same sirtuation exposed at the beginning of this post and several errors in files from pages 193 to 198

Thanks in advance for your kind of attention.

Sultan :U

Sevag.K

Quote from: Sultan on September 28, 2005, 02:58:28 AM
Quote from: Sevag.K on April 03, 2005, 10:07:00 PM
Slight correction to my statement above.

If you want to use "stdlib.hhf" you may include it on a line *after* "win32cons.hhf"
eg:

#include ("win32cons.hhf")
#include ("stdlib.hhf")



Where can I get Win32cons.hhf ?

I just have win32.hhf
and console.hhf

I ´m also in the same sirtuation exposed at the beginning of this post and several errors in files from pages 193 to 198

Thanks in advance for your kind of attention.

Sultan :U


The win32cons.hhf and library come with the "hlaexamples" archive on webster

http://webster.cs.ucr.edu/AsmTools/HLA/dnld.html

(scroll down past half way).  Note that I've had some problems with this before and had to recompile the library to make it work.

A working library and header file are also included with my HIDE (HLA IDE) package
http://www.geocities.com/kahlinor/HIDE.html

HIDE includes all the programs you need (including HLA), and runs with no setup right out of its own folder.  Of course, it probably won't work on your system if you have Win2000 (HIDE has been tested on Win98se, WinME and winXP).

Also don't forget, since "win32cons.hhf" sets a global compile-time variable, it needs to be included before "stdlib.hhf" in your source code.

indiocolifa

Why HIDE does not work under Windows 2000?

Sevag.K

Quote from: indiocolifa on September 28, 2005, 02:25:16 PM
Why HIDE does not work under Windows 2000?

I have no idea.  I don't have a 2000 box to debug it on.


Sultan

Sevag.k:

Is win32cons.hhf the only one I have to copy or there is some more ( .hhf .lib etc. ) to get ?

Sultan :U

Sevag.K

Quote from: Sultan on September 29, 2005, 02:58:43 PM
Sevag.k:

Is win32cons.hhf the only one I have to copy or there is some more ( .hhf .lib etc. ) to get ?

Sultan :U

You also need to copy the library and link it with your code.  The library is either wincons.lib or win32cons.lib


Sultan

OPS !

I´m still at the same position my friend !

I did copy of everything what you stated and before to do that, I actualized the newest version of HLA, then copy the files from HIDE, but at the end, nothing happen.

By the way, I decided to show what the errors are, so, you can see better what is happening here.

As the matter of fact here they are:

File TestGotoxy       Page 193 & 194 

C\hla\projects\TestGo>hla testgo~1.hla
Error in file "testgo~1.hla" at line 48 [errid:4792/codegen.c]:
Parameter type mismatch (X).
Near << , >>
Error in file "testgo~1.hla" at line 48 [errid:4792/codegen.c]:
Near: << ) >>
Assembling: testgo~1.asm


File: testSetOutputAttr   Page 196 & 197

C:\hla>hla testse~1.hla
Error in file "testse~1.hla" at line 13 [errid:54740/hlaparse.bsn]:
Expected ´:´, encountered ´( ´
(Possible undefined ID 'console' ).
Near: << . >>

Assembling: testse~1.asm
testse~1.asm(78) : fatal error A1010: unmatched block nesting : _HLAMain
LINK : fatal error LNK1181: cannot open input file "testse~1.obj"


File testGetxy:      Page 194 & 195


C:\hla\projects\testGetxy>hla testge~1.hla
Error in file "testge~1.hla" at line 47 [errid:4799/codegen.c]:
Parameter type mismatch (x)
Near: << , >>

Error in file "testge~1.hla" at line 47 [errid:4799/codegen.c]:
Parameter type mismatch   (y)
Near: << ) >>

Assembling: testge~1.asm
Testge~1.asm(77) : error A2008: syntax error :.
Testge~1.asm(80) : error A2008: syntax error :.
LINK : fatal error LNK1181: cannot open input file "testge~1.obj"


File: Test FillRect:    Page 197 & 198

C:\hla>hla testfi~1.hla
Error in file "testfi~1.hla" at line 11 [errid:54740/llaparse.bsn]:
Expected ´:´, encountered ´(
<Possible undefined ID ´.setOutputAttr´ ).
Near: << ( >>

Assembling: testfi~1.asm
Testfi~1.asm(80) : fatal error A1010: unmatched block nesting : _HLAMain
LINK : fatal error LNK1181: cannot open input file "testfi~1.obj"

Thanks in advance again bud

Sultan



Sevag.K

Which document are you getting these examples from?

Sultan

The Art of Assembly Lenguage

Sevag.K

I can't find you page references on either the printed or the online version.  Mind sending me a copy of the soucres?

Sultan

OK Sevag.K

First of all thanks for the quick reply and for to be in touch posting over this matter.

My problem is that I cannot compile or make the .exe in the samples that come indeed the Art of Assembly Lenguage book at pages 194 to 198 like I set in a post before this one.

By the way they are located Volume II Chapter 11 mean 2.11.2, 2.11.3, 2.11.4 from pages 294 to 298 of that book

Hope this help, otherwise I copy the sample and send it to you in a word file.

Regards.

Sevag.K

Quote from: Sultan on October 02, 2005, 04:19:48 AM
OK Sevag.K

First of all thanks for the quick reply and for to be in touch posting over this matter.

My problem is that I cannot compile or make the .exe in the samples that come indeed the Art of Assembly Lenguage book at pages 194 to 198 like I set in a post before this one.

By the way they are located Volume II Chapter 11 mean 2.11.2, 2.11.3, 2.11.4 from pages 294 to 298 of that book

Hope this help, otherwise I copy the sample and send it to you in a word file.

Regards.

That won't be necessary, thanks.  I found them.

Here is what you need:

win32cons.hhf
wincons.lib
change occurences of console namespace to win32cons namespace:

Eg:

console.gotoxy (5, 10);  becomes:
win32cons.gotoxy (5, 10);

Here is one sample:


// testGotoxy.hla
// build with:
// hla testGotoxy wincons.lib

program testGotoxy;

#include( "win32cons.hhf") // include win32cons.hhf here
#include( "stdlib.hhf" )

// instead of consle.xxx
// use win32cons.xxx

var

    x:int16;

    y:int16;



begin testGotoxy;



    // Throw up some text to prove that

    // this program really clears the screen:



    stdout.put

    (

        nl,

        "HLA console.gotoxy() Test Routine", nl,

        "---------------------------------", nl,

        nl,

        "This routine will clear the screen then demonstrate the use", nl,

        "of the gotoxy routine to position the cursor at various", nl,

        "points on the screen.",nl,

        nl,

        "Press the Enter key to continue:"

    );



    // Make the user hit Enter to continue.  This is so that they

    // can control when they see the effect of console.gotoxy.



    stdin.readLn();



    // Okay, clear the screen:



    win32cons.cls();





    // Now demonstrate the gotoxy routine:



    win32cons.gotoxy( 5,10 );

    stdout.put( "(5,10)" );



    win32cons.gotoxy( 10, 5 );

    stdout.put( "(10,5)" );



    mov( 20, x );

    for( mov( 0,y ); y<20; inc(y)) do



        win32cons.gotoxy( y, x );

        stdout.put( "(", x, ",", y, ")" );

        inc( x );



    endfor;



end testGotoxy;