News:

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

AoA Program 4.4

Started by sefaen, February 09, 2009, 05:40:47 AM

Previous topic - Next topic

sefaen

Here is the code straight from the book:
program dataInterpretation;

#include( "stdlib.hhf" );

static

    r:  real32 := -1.0;

   

begin dataInterpretation;



   

    stdout.put( "`r' interpreted as a real32 value: ", r:5:2, nl );

   

    stdout.put( "`r' interpreted as an uns32 value: " );

    mov( r, eax );

    stdout.putu32( eax );

    stdout.newln();

   

    stdout.put( "`r' interpreted as an int32 value: " );

    mov( r, eax );

    stdout.puti32( eax );

    stdout.newln();

   

    stdout.put( "`r' interpreted as a dword value: $" );

    mov( r, eax );

    stdout.putd( eax );

    stdout.newln();

   

end dataInterpretation;


I get this build error:
Build :C:\hla\dataInterpretation.hla
-C:\hla\dataInterpretation.hla
Error in file "hla.hhf" at line 685 [errid:64677/hlaparse.bsn]:
Macro called in file "stdout.hhf" at line 636
Macro called in file "C:\hla\dataInterpretation.hla" at line 17
Too many actual parameters.
Near: << , >>

Error in file "hla.hhf" at line 685 [errid:8493/output.c]:
Macro called in file "stdout.hhf" at line 636
Macro called in file "C:\hla\dataInterpretation.hla" at line 17
Type of constant actual parameter does not
agree with type of formal parameter.
Near: << ) >>

Return :2
------------------------------------------------------------------------


If I change line 17 to:
stdout.put( "`r' interpreted as a real32 value: ", r:5, nl );
it compiles.

I tried compiling the unaltered program from the command line, and it works.
Microsoft Windows [Version 6.0.6001]
Copyright (c) 2006 Microsoft Corporation.  All rights reserved.

C:\Users\Administrator>cd\hla

C:\hla>hla -v dataInterpretation
HLA (High Level Assembler)
Use '-license' to see licensing information.
Version Version 1.99 build 12920 (prototype)
Win32 COFF output
OBJ output using internal FASM back-end
-test active

HLA Lib Path:     c:\hla\hlalib\hlalib.lib
HLA include path: c:\hla\include
HLA temp path:
Linker Lib Path:  ;c:\hla\hlalib;c:\hla\hlalib

Files:
1: dataInterpretation.hla

Compiling 'dataInterpretation.hla' to 'dataInterpretation.obj'
using command line:
[hlaparse -level=high  -v -sf -ccoff -test "dataInterpretation.hla"]

----------------------
HLA (High Level Assembler) Parser
use '-license' to view license information
Version Version 1.99 build 12919 (prototype)
-t active
File: dataInterpretation.hla
Output Path: ""
Language Level: high

Compiling "dataInterpretation.hla" to "dataInterpretation.obj"
Compilation complete, 9007 lines,   0.052 seconds,  173212 lines/second
Using flat assembler version C1.66
3 passes, 1457 bytes.
----------------------
Linking via [polink @"dataInterpretation.link._.link"]
POLINK: warning: /SECTION:.bss ignored; section is missing.

C:\hla>dataInterpretation
`r' interpreted as a real32 value: -1.00
`r' interpreted as an uns32 value: 3212836864
`r' interpreted as an int32 value: -1082130432
`r' interpreted as a dword value: $BF80_0000

C:\hla>


Why does HIDE give me build errors, and running the compiler from the cmd line not. Does the -v switch have anything to do with it?

Sorry, for so many posts.

Edit: specs ->

Hardware:
Gateway P-6831FX Notebook
Core 2 Duo (Centrino Duo) T5450 @ 1.66Ghz
3GB PC800

Software:
Windows Vista Ultimate 64-bit
HLA v1.99
MASM32 v10
HIDE  v1.27

Enviroment Variables:

User variables
------------------
TEMP = %USERPROFILE%\AppData\Local\Temp
TMP = %USERPROFILE%\AppData\Local\Temp

System Variables
-----------------------
ComSpec = %SystemRoot%\system32\cmd.exe
DFSTRACINGON = FALSE
FP_NO_HOST_CHECK = NO
hlainc = c:\hla\include
hlalib = c:\hla\hlalib\hlalib.lib
include = c:\hla\include;c:\masm32\include;%include%
lib = ;c:\hla\hlalib
NUMBER_OF_PROCESSORS = 2
OS = Windows_NT
Path = c:\hla;c:\masm32\bin;%path%;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem
PATHEXT = .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
PROCESSOR_ARCHITECTURE = AMD64
PROCESSOR_IDENTIFIER = Intel64 Family 6 Model 15 Stepping 13, GenuineIntel
PROCESSOR_LEVEL = 6
PROCESSOR_REVISION = 0f0d
TEMP = %SystemRoot%\TEMP
TMP = %SystemRoot%\TEMP
TRACE_FORMAT_SEARCH_PATH = \\NTREL202.ntdev.corp.microsoft.com\34FB5F65-FFEB-4B61-BF0E-A6A76C450FAA\TraceFormat
USERNAME = SYSTEM
windir = %SystemRoot%

Sevag.K


Seems to work fine with HIDE on my end, are you sure no illegal characters got in while pasting?

sefaen

it only seems to compile if I comment out:

stdout.put( "`r' interpreted as a real32 value: ", r:5:2, nl );

I've tried retyping the line to make sure there are no illegal characters

Sevag.K

Can't seem to find the problem.  I copied the code you posted directly from the code above without commenting anything and did not get compile errors.

Can you give more specifics on what version of HIDE you are using and if you've done any custom upgrades to it (such as overwriting any files in the default folders).


sefaen

I am using version 1.27.xx found here(direct link).

This is how I installed HIDE:

I extracted and merged the HIDE folder with my HLA folder. I tried without overwriting the HLA 1.99 files and also tried overwriting them with the files included with HIDE. I still can't get it to compile for some reason.

I followed the steps here to i nstall HLA/MASM32.

Sevag.K


This seems to be a bug with hla 1.99 support files.

The problem can be fixed by copying "stdout.hhf" from the latest hla archive ( "hla\include\stdout.hhf" ) into the HIDE\hlainc folder, overwriting the existing "stdout.hhf" file.
Alternatively, you can change the HIDE hlainc folder from Options->Set Paths menu to point to the hla\include folder (correct path required) instead of the %h\hlainc folder.

sefaen

Yeah changing the paths worked for me. Thanks again  :)