Darkwolf2

Differences between revisions 9 and 10
Revision 9 as of 2007-05-26 03:05:56
Size: 2599
Editor: balt-209-150-116-134
Comment:
Revision 10 as of 2007-05-26 03:44:13
Size: 3139
Editor: balt-209-150-116-134
Comment:
Deletions are marked like this. Additions are marked like this.
Line 38: Line 38:
hla ./hello.hla hla hello.hla
Line 65: Line 65:
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 *.asm
}}}

Source 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.

DarkWolf

Email: MailTo(lycanos AT hotmail DOT com)


Linux Assembly Using HLA

Latest version of HLA is 1.96 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! Tongue out :-?

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.... )

  • Info (!) 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.

  • (OK) 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 *.asm

Source 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 )

[http://webster.cs.ucr.edu/]

  • 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/]


CategoryHomepage CategoryDocumentation

Darkwolf2 (last edited 2010-03-29 21:20:51 by balt-209-150-116-212)