That's right!
HLA v1.32 runs under both Windows and Linux.
Best of all, (well-written) HLA programs will compile
and run on either operating system unchanged!
(Who says assembly language can't be portable?)
You can download a Linux or Windows (or both) version
of HLA v1.32 from
http://webster.cs.ucr.edu
HLA, the High Level Assembler, is a powerful x86 assembly
language that supports a Pascal/C/Modula-2-like syntax
that makes learning and using assembly language very easy.
Although originally written as a tool to teach assembly
language programming to University Students, HLA's
advanced features make it a natural for advanced assembly
language programmers as well.
The HLA package includes the "HLA Standard Library" a package
of hundreds of functions, macro, data declarations, and other HLA
code, that makes assembly language programming trivial.
The HLA Standard Library is available for Linux and Windows,
so code that calls the HLA Standard Library is portable between
the two OSes.
A Linux edition of "The Art of Assembly Language Programming"
provides the perfect text for beginners who know a high level
programming language and want to learn assembly language
programming under Linux. You can find "Art of Asm" at the
Web URL above.
In addition to the 1,500 pages appearing in the "Art of Asm,"
the HLA package also includes over 500 pages of documentation,
articles, and other information related to HLA programming.
Programs written in HLA are far more readable than programs
written in traditional assembly language. For example, here
is the ubiquitous "Hello World" program written in HLA:
program HelloWorld;
#include( "stdlib.hhf" )
begin HelloWorld;
stdout.put( "Hello World" nl );
end HelloWorld;
No, this doesn't look at all like assembly language, but that's
because it's such a trivial program (just invokes a macro
in the HLA Standard Library). Here's a more practical example
that actually has some recognizable machine instructions in it:
program DemoRecursion;
#include( "stdlib.hhf" );
var
myfib:int32;
/*
** Compute fibonocci sequence (digusting, slow, way )
** using a recursive call.
*/
begin fib;
if( n <= 2 ) then
mov( 1, eax );
else
mov( n, eax ); // Compute fib( n-1 );
dec( eax );
fib( eax );
push( eax ); // Save result of fib(n-1);
mov( n, eax ); // Compute fib( n-2 );
sub( 2, eax );
fib( eax );
add( [esp], eax ); // Add fib(n-1) and fib(n-2)
add( 4, esp ); // Clean up stack.
endif;
end fib;
begin DemoRecursion;
mov( 0, myfib );
while( myfib < 10 ) do
fib( myfib );
stdout.put( "fib(", myfib, ") = ", (type int32 eax ), nl );
inc( myfib );
endwhile;
end DemoRecursion;
For die-hard assembly fans, don't get the impression that
you have to use statements like "IF" and "WHILE" in an
HLA program. HLA also allows CMPs and conditional
jumps if you prefer to write your assembly code the old fashioned
way.
HLA is totally free (i.e., public domain) and is available in
executable and source form. HLA was written using Flex/Bison/C
and a few lines of assembly code (HLA).
Don't let the version number fool you.
HLA has been around since 1999 and "v1.32" signifies that
HLA has gone through 32 revisions since version 1.0
(the build counter is in excess of 5000 builds as this is
being written). While HLA v1.x is a prototype for the
HLA language, it has found use on some very major projects
(including the implementation of HLA v2.0 currently underway).
While HLA certainly isn't "defect-free," it has had several years
of use and has achieved a level of quality few public domain
programs ever achieve.