b r a y d e n . o r g / Software

/ LinkPage030913? / HighLevelAssembler

This Web


WebHome  
Topic List  
Web Statistics 

All Webs


Books
Main
Random
Software
TWiki  

brayden.org


Home
Monthly Digest
Today's Links
Resumé
Reading List
Books RSS
Random RSS
Software RSS

Other


Joanne's Blog
Dale's Blog

Bloglines
currently-reading
Jetable email
TextDrive
Progressive Magazine
out campaign

The Art of Assembly Language Programming - book and online book, HLA (High Level Assembler) links to downloads, tutorials, and sample code

High Level Assembler - HLA

HLA, High Level Assembler, is an open source (public domain) assembler for 80x86 CPU on Linux and Windows written by an instructor at UC Riverside named Randall Hyde. He has made a huge website with book-length information about assembly language programming and that material has now been reworked into a book published by No Starch Press.

This is a very high-level assember indeed. In fact, it's quite easy to not recognize its source code as assembler at all. For example, here's the Hello World program:

program HelloWorld;
#include( "stdlib.hhf" )
begin HelloWorld;
  stdout.put( "Hello, World of Assembly Language", nl );
end HelloWorld;

As you see, HLA provides a sort of object-oriented library. See below for some more simple examples.

The HLA development kit is not small. Besides HLA itself (for which there is a Windows installer) you will also need MASM (ml.exe), which you can also get from Hyde's download page. The package is called MASM32 and includes a huge number of ASM examples.

HLA itself comes with an almost unbelievable amount of sample code, which you must download separately from the HLA installer. And the entire electronic version of the book is evailable for download in a zip file.

Links

More Examples

Fibonacci number generator

// This program generates the fibonocci
// sequence for n=1..40.
//
// The fibonocci sequence is defined recursively
// for positive integers as follows:
//
//  fib(1) = 1;
//  fib(2) = 1;
//  fib( n ) = fib( n-1 ) + fib( n-2 ).
//
//  This program provides an iterative solution.

program fib;
#include( "stdlib.hhf" );
static
    FibCntr:    int32;
    CurFib:     int32;
    LastFib:    int32;
    TwoFibsAgo: int32;
begin fib;
    // Some simple initialization:
    mov( 1, LastFib );
    mov( 1, TwoFibsAgo );
    // Print fib(1) and fib(2) as a special case:
    stdout.put
    (
        "fib( 1) =         1", nl
        "fib( 2) =         1", nl
    );
    // Use a loop to compute the remaining fib values:
    mov( 3, FibCntr );
    while( FibCntr <= 40 ) do
        // Get the last two computed fibonocci values
        // and add them together:
        mov( LastFib, ebx );
        mov( TwoFibsAgo, eax );
        add( ebx, eax );
        // Save the result and print it:
        mov( eax, CurFib );
        stdout.put( "fib(",FibCntr:2, ") =", CurFib:10, nl );
        // Recycle current LastFib (in ebx) as TwoFibsAgo,
        // and recycle CurFib as LastFib.
        mov( eax, LastFib );
        mov( ebx, TwoFibsAgo );
        // Bump up our loop counter:
        add( 1, FibCntr );
    endwhile;
end fib;

-- DaleBrayden - 14 Sep 2003

 
 
Current Rev: r1.1 - 14 Sep 2003 - 17:49 GMT - DaleBrayden, Revision History:Diffs | r1.1
© 2003-2006 by the contributing authors.