Home > ubuntu > High Level Assembly (HLA)

High Level Assembly (HLA)

If you were always afraid of assembly but you still wanted to try it, HLA is for you.

High Level Assembler (HLA) is an assembly language developed by Randall Hyde. It allows the use of higher-level language constructs to aid both beginners and advanced assembly developers. It fully supports advanced data types and object-oriented assembly language programming. It uses a syntax loosely based on several high-level languages (HLL), such as Pascal, Ada, Modula-2, and C++, to allow creating readable assembly language programs, and to allow HLL programmers to learn HLA as fast as possible.” (source)

Hello, World!
To demonstrate how easy it is to use, here is the classical “Hello World” program in HLA:

program helloWorld;
#include( "stdlib.hhf" );

begin helloWorld;

    stdout.put( "Hello, World!", nl );

end helloWorld;

Compilation and running:

$ hla hello.hla 
$ ./hello 
Hello, World!

Installing the HLA compiler
Here I found a description on how to install HLA on Ubuntu. In short:

Go to this page and download the first three archives. When you extract them, they will create a “usr” folder with “hla” inside. I moved “hla” to /opt, so I got this hierarchy: /opt/hla/hlalib, /opt/hla/hlasrc, etc.

In /usr/bin, put symbolic links on /opt/hla/hla and /opt/hla/hlaparse.

Edit your .bashrc file:

# HLA (high level assembly)
HLA_HOME=/opt/hla
hlalib=$HLA_HOME/hlalib
hlainc=$HLA_HOME/include
hlatemp=/tmp
export HLA_HOME hlalib hlainc hlatemp

Source it or open a new terminal. Now you can try to compile hello.hla.

Tips
Get some help:

hla -?

Get more verbosity:

hla -v hello.hla

Compile to .asm file:

hla -s hello.hla

Links

  1. No comments yet.
  1. No trackbacks yet.

Leave a comment