Hey guys, n00b13 here when it comes to assembly, need your expertise! So i'm following an example from a book i just bought for the hello world statement,
program HelloWorld;
#include("stdlib.hhf")
begin HelloWorld;
stdout.put("Hello, World of Assembly Language", nl);
end HelloWorld;
Here is the error I am getting:
HLA (High Level Assembler) Parser
use '-license' to view license information
Version 2.7 build 3276 (prototype)
-test active
File: /Users/martinvanputten/Desktop/hw.hla
Output Path: ""
hlainc Path: "/usr/hla/include"
hlaauxinc Path: ""
Compiler generating code for Mac OSX OS
Back-end assembler: HLABE
Language Level: high
Assembling "/Users/martinvanputten/Desktop/hw.hla" to "/Users/martinvanputten/Desktop/hw.o"
Error in file "/Users/martinvanputten/Desktop/hw.hla" at line 1 [errid:126135/hlaparse.c]:
syntax error, unexpected '{', expecting DoOneValStmt.
Near: << { >>
HLAPARSE assembly failed with 1 errors
As you can see the compiler sees I'm runnin OS X... so I was thinking maybe it is the way I set up the environment variables... heres what I did... I added the statements to the bashrc file and got this error so I decided to add it to the rc.common file in the /etc directory to see if that would make a difference, adding /usr/hla (the path to the compiler) to $PATH... below is what I did:
bashrc
PATH=$DBROOT/bin:$DBROOT/pgm:/usr/hla:$PATH
hlalib=/usr/hla/hlalib
export hlalib
hlainc=/usr/hla/include
export hlainc
rc.common
PATH=/usr/hla:/bin:/sbin:/usr/bin:/usr/sbin:/usr/libexec:/System/Library/CoreSe$
hlalib=/usr/hla/hlalib
export hlalib
hlainc=/usr/hla/include
export hlainc
Notice I simply added /usr/hla to the path in rc.common where I had created the entire Path variable in bashrc copying from the book (which I am assuming DBROOT is more of a linux thing.
I don't think there is an issue with my code, looks legit to me but what do I know, can anybody verify my environment variable configuration or point out the problem (probably being very simple yet invisible to my eyes).
Thanks guys!
Your environment seems okay, the compiler seems to think there is a brace character '{' in the source. This could have happened if you copied and pasted from an html document.
If the source is clean, there could be a problem with the Mac version which should be brought to Randal's attention.
Try CD'ing into the source directory before compiling. That's the only difference I can see between your example and my (successful) test run of it.
Cheers,
Randy Hyde
Thanks for responding... I navigated to ~/Desktop where hw is sitting and still the same issue... I'm going to rig up a linux machine and test it, will keep you posted, any other ideas are greatly appreciated.
Hey guys, rigged a linux box and got the same error... looked at my code again and took out the new line when outputing the text and it worked... tried again on my mac and it worked after taking out the line. I think the issue is that I typed in n1 instead of nl... thanks for helping guys.
Someone should confirm this on the non-windows versions. Typing n1 instead of nl gives a meaningful error message in Windows.