The MASM Forum Archive 2004 to 2012

Project Support Forums => HLA Forum => Topic started by: DarkWolf on October 26, 2008, 10:49:25 PM

Title: HLABasic2 question
Post by: DarkWolf on October 26, 2008, 10:49:25 PM
bc and bd compiled without a problem, be/bx will compile too (but not separately).
bc throws an exception when I try to compile basic source.


$ ./bc test.bas

Triga-Basic Compiler v2.0
Compiling 'test.bas' to 'test.tbbc'

   1:  test:
   2:  LET test = "hello"
HLA Exception (53)
Memory Access Violation
Error reading file 'test.bas'


test.bas:

test:
LET test = "hello"
print test


I at first thought maybe because I reused a statement label as a variable but changing it doesn't resolve the exception.
I haven't tried bd or be yet, without having any bytecode to decompile or run.
Title: Re: HLABasic2 question
Post by: Evenbit on October 27, 2008, 04:41:02 AM
There is an error in the documentation.  Remove the "LET" and it will compile.

test = "Hello"
print test


You will need a program like the following in order to run the compiled program:

run.hla // compile with "hla -nolibc run bx"

program runbasic;
#include( "stdlib.hhf" )
#include( "basic.hhf" )

var

mycode :rtPgmClass;

begin runbasic;

mov( false, bl );
arg.c();
if( eax < 2 || eax > 3 ) then

stdout.put( "ERRusage:  run program.tbbc <<anything>>" nl );
stdout.put( "Any second parameter will turn DEBUG mode on." nl );
os.exitProcess( 1 );

elseif( eax = 3 ) then

mov( true, bl );

endif;
arg.a_v( 1 );
mycode.create( eax, 0 );
mov( bl, mycode.debugFlag );
mycode.run();
mycode.destroy();

end runbasic;


Nathan.
Title: Re: HLABasic2 question
Post by: DarkWolf on November 01, 2008, 04:48:28 AM
I get the same error without the 'LET' or statement label.

$ ./bc test.bas

Triga-Basic Compiler v2.0
Compiling 'test.bas' to 'test.tbbc'

   1:  testvar = "hello"
HLA Exception (53)
Memory Access Violation
Error reading file 'test.bas'


I was trying to compile the 'be' standalone example for running the basic code.