Hi
I'm just starting out trying to learn assembler, using HLA and the
"Art of Assembler". I am having problems executing very simple demo
programs.
A hello world program works, however as soon as I introduce a
variable, I get a segfault. I have given a working and broken example
below.
Apologies if I have done something stupid(!) , but any help would be
appreciated. Please let me know if you need anymore information to
help...
Kind Regards
David
[david@[EMAIL PROTECTED]
] $ uname -a
Linux beechwood.home 2.6.23.15-137.fc8 #1 SMP Sun Feb 10 17:48:34 EST
2008 i686 i686 i386 GNU/Linux
====WORKING=====
[david@[EMAIL PROTECTED]
] $ more HelloWorld.hla
program helloWorld;
#include( "stdlib.hhf" );
begin helloWorld;
stdout.put( "Hello, World of Assembly Language", nl );
end helloWorld;
[david@[EMAIL PROTECTED]
] $ hla -v HelloWorld.hla
HLA (High Level Assembler)
Use '-license' to see licensing information.
Version Version 1.99 build 12923 (prototype)
ELF output
OBJ output using internal FASM back-end
-test active
HLA Lib Path: /home/david/local/hla/hlalib/hlalib.a
HLA include path: /home/david/local/hla/include
HLA temp path:
Files:
1: HelloWorld.hla
Compiling 'HelloWorld.hla' to 'HelloWorld.o'
using command line:
[hlaparse -level=high -v -sf -celf -test "HelloWorld.hla"]
----------------------
HLA (High Level Assembler) Parser
use '-license' to view license information
Version Version 1.99 build 12923 (prototype)
-t active
File: HelloWorld.hla
Output Path: ""
Language Level: high
Compiling "HelloWorld.hla" to "HelloWorld.o"
Compilation complete, 14837 lines, 0.214 seconds, 69332 lines/
second
Using flat assembler version C1.66
3 p*****, 1499 bytes.
----------------------
Linking via [ld -o "HelloWorld" "HelloWorld.o" "/home/david/local/
hla/hlalib/hlalib.a"]
[david@[EMAIL PROTECTED]
] $ ./HelloWorld
Hello, World of Assembly Language
====BROKEN=====
[david@[EMAIL PROTECTED]
] $ more
HelloWorldWithVar.hla
program helloWorld;
#include( "stdlib.hhf" );
static
InitDemo: int32 := 5;
begin helloWorld;
stdout.put( "Hello, World of Assembly Language", nl );
stdout.put( "InitDemo's value is ", InitDemo, nl );
end helloWorld;
[david@[EMAIL PROTECTED]
] $ hla -v
HelloWorldWithVar.hla
HLA (High Level Assembler)
Use '-license' to see licensing information.
Version Version 1.99 build 12923 (prototype)
ELF output
OBJ output using internal FASM back-end
-test active
HLA Lib Path: /home/david/local/hla/hlalib/hlalib.a
HLA include path: /home/david/local/hla/include
HLA temp path:
Files:
1: HelloWorldWithVar.hla
Compiling 'HelloWorldWithVar.hla' to 'HelloWorldWithVar.o'
using command line:
[hlaparse -level=high -v -sf -celf -test "HelloWorldWithVar.hla"]
----------------------
HLA (High Level Assembler) Parser
use '-license' to view license information
Version Version 1.99 build 12923 (prototype)
-t active
File: HelloWorldWithVar.hla
Output Path: ""
Language Level: high
Compiling "HelloWorldWithVar.hla" to "HelloWorldWithVar.o"
Compilation complete, 15683 lines, 0.223 seconds, 70327 lines/
second
Using flat assembler version C1.66
3 p*****, 1644 bytes.
----------------------
Linking via [ld -o "HelloWorldWithVar" "HelloWorldWithVar.o" "/
home/david/local/hla/hlalib/hlalib.a"]
[david@[EMAIL PROTECTED]
] $ ./HelloWorldWithVar
Hello, World of Assembly Language
InitDemo's value is Segmentation fault


|