Darkwolf2
DarkWolf
Email: MailTo(lycanos AT hotmail DOT com)
Linux Assembly Using HLA
Latest version of HLA is 1.97 and now includes FASM written into the HLA executable. HLA will now compile executables itself. Linux version can use either FASM or GAS.
HLA 2.0 is close to completion, it is being written in HLA and for multiple platfroms. Current cross-platform is a kludge ( Linux version is the C files compiled and FreeBSD is a port of that ). It will be more organized and designed with more efficiency in mind.
Though personally I think the current version is pretty efficient, it's Assembler!
Setup
Download and extract HLA package (links at bottom of page). There is no installation and to remove you only have to delete the extracted files. You can install anywhere just be sure to add the path to the library and includes to your .bashrc file. ( See Below )
Be sure to add the following to your .bashrc file. Link HLA to /bin to avoid having to update your path.
export hlalib=/path/to/HLA/hlalib/hlalib.a export hlainc=/path/to/HLA/include
( I think the proper link command is sudo ln -s ./hla /bin but I need to research this more.... )
KHLA from Sevag is also useful because of the ability to control some link options, link that to /bin too.
To test your setup copy the Hello World program into a file called hello.hla and compile with the following command.
hla hello.hla
You should then have an executable called hello , run it from the terminal and you should see the following output.
Hello, World of Assembly Language
Now you are on your way to writing programs in assembly on Linux.
HLA will run on any Win32, Linux and FreeBSD platform.
Sample Coding
Sample HLA source code ( Your Standard Hello World ):
program HelloWorld;
#include( "stdlib.hhf" )
begin HelloWorld;
stdout.put( "Hello, World of Assembly Language", nl );
end HelloWorld;Sample Makefile and Source: Makefile:
test: test.o
hla -x:test test.o
test.o: test.hla
hla -c test.hla
clean:
rm *.o
rm *.asmSource Code:
program testLinux;
#include( "stdlib.hhf" )
begin testLinux;
stdout.put( "Hello, World of Assembly Language", nl );
end testLinux;-x:name will specifiy the name of the executable. -c will compile to obj code only. Both must be followed by the filename of the file to be compiled. Check HLA docs and -? switch for more info.
HLA Software
- Randall Hyde's HLA for Linux/Windows ( High Level Assembler )
- Sourceforge Project for the HLA Standard Library ( the forthcoming community supported HLA 2.0 )
[http://sourceforge.net/projects/hla-stdlib]
- Sevag's HLA utilities ( Linux / Windows )
[http://www.geocities.com/kahlinor/HLA.html]
- Hutch's Forum; MASM32 platform, HLA and others ( beta software can be found here too )
[http://www.masm32.com/board/]