HLA: The High Level Assembly Programming Language
At the eastern edge of US-60, between University Avenue and the Box Springs Mountain Park, sits the bustling University of California-Riverside (UCR) campus. A modern university, encompassing everything from botany to computer science, UCR employs some of the finest professors in the entire southwestern United States. UCR was established as a campus of the University of California in 1954. Today, it boasts an enrollment of over 17,000 students.
The High Level Assembly (HLA) programming language began at UCR in 1996 as a project of computer science professor Randall Hyde. Hyde began his project envisioning a programming language that everyone would love. He writes:
When I began writing HLA in the fall of 1996, I had visions of creating one of those "universally accepted" language projects that everyone would love. I'd get big "pats on the back" and people would talk about how great I was. [But] as the design for HLA began to solidify, and I had to make some hard decisions about compromises in the language, those visions of glory faded quickly."
Hyde released the first prototype of HLA in September 1999, designated Version 1.0. As he expected, some people voiced complaints about the new programming language. As Hyde admits:
I fully expected some people to voice rigorous complaints about the language itself. I was not disappointed. One thing, however, that I should have forseen and prepared for is the fact that a large number of people would voice complaints about HLA in total ignorance. That is, I didn't anticipate some individuals looking at some sample code and making assumptions about the language without first looking to see if those complaints were valid.
HLA was developed initially as a tool to teach assembly language programming. As Hyde notes:
The principle goal of HLA was to leverage students' existing programming knowledge. For example, good Pascal programmers can get their first C/C++ program operational in a few minutes. In HLA, I wanted to create a language with high level control structures and declarations that made it possible for someone familiar with an imperative language like Pascal or C/C++ to get their first HLA programming running in a matter of minutes (or, at worst, a matter of hours). Of course, to achieve this goal, I needed to add high-level data declarations and high-level control constructs to the HLA language.
But how does HLA differ from other High Level Assembly languages? According to Hyde, the differences are fairly complex. He notes:
HLA/86 probably falls in the high-level-to-very-high-level range because it provides high level data types and data structuring abilities, high level and very high level control structures, extensive parameter passing facilities (more than most high level languages), a very extensive compile time language, a very extensive standard library, built-in parsing facilities for language extension, and many other features.
The average programmer starting out on HLA no doubt will be reading the HLA Standard Reference Manual for quite awhile before he or she begins to write the first HLA program. I myself spent over two hours simply reading and taking notes on how assembly differed from BASIC, C/C++ and Pascal, other languages I had tried previously. The learning curve was indeed steep, but the rewards were worth it. As I noted on my project page for my game HLA Adventure, "HLA stands for High Level Assembly, and it's a great way for people to learn assembly without being submerged off the bat in offsets, memory locations and MOV instructions."
HLA Adventure is one of many HLA-related projects now being developed by programmers around the world. For example, Sevag Krikorian is developing HIDE, an integrated development environment for use in coding, debugging and compiling HLA programs. HIDE even was written in HLA.
For those interested in learning more about HLA and the Art of Assembly Language programming, Yahoo Groups offers aoaprogramming, which, as the Web site states, is a "forum for those interested in learning and working with Randall Hyde's HLA assembler." At the time of this writing, aoaprogramming had over 1,089 members.
HLA currently is available for both Windows and Linux. First introduced by Hyde in March of 2002, the Linux version of HLA eventually incorporated console-mode functions usable in both Windows and Linux. This change allowed console programs relying on specific console mode functions to be compiled successfully under both Windows and Linux. As Hyde notes, "The VT100 terminals emulation that Linux supports has only a subset of the capabilities of the original HLA Console library, so many things are not implemented from the old library."
A simple HLA program, called test.hla and using standard console-mode functions, might contain the following code:
>
// Player vs. Dragon demo. An example of HLA code.
// ------------------------------------------------------
// Sample game introduction of "Player vs. Dragon".
// ------------------------------------------------------
program west;
// ------------------------------------------------------
// Include files "console.hhf" and "stdlib.hhf" into
// the program.
// ------------------------------------------------------
#include("console.hhf");
#include("stdlib.hhf");
// ------------------------------------------------------
// Begin program "west".
// ------------------------------------------------------
begin west;
// ------------------------------------------------------
// Set console foreground color to white, background
// to blue.
// ------------------------------------------------------
console.setAttrs( console.white, console.blue );
// ------------------------------------------------------
// Clear the console screen.
// ------------------------------------------------------
console.cls();
// ------------------------------------------------------
// Start the main loop of the program, designated
// "mainlp".
// ------------------------------------------------------
mainlp:
// ------------------------------------------------------
// Change foreground color to green, background to blue.
// ------------------------------------------------------
console.setAttrs( console.green, console.blue );
// ------------------------------------------------------
// Use "stdout.puts" to display text on the console
// mode screen. "nl" means "next line".
// ------------------------------------------------------
stdout.puts("A green dragon approaches, spreading her wings high" nl);
stdout.puts("across the landscape, plunging it into darkness! The" nl);
stdout.puts("dragon looks at you and says:");
// ------------------------------------------------------
// Change foreground color to yellow, background to blue.
// ------------------------------------------------------
console.setAttrs( console.yellow, console.blue );
// ------------------------------------------------------
// Use "stdout.puts" to display more text.
// ------------------------------------------------------
stdout.puts(" 'I am the last of my kind." nl);
stdout.puts("Here you are, a human, come here to slay me?! I breathe" nl);
stdout.puts("fire upon trees, rustling the bad kami out of the forests" nl);
stdout.puts("and valleys of this forgotten world. I keep my peace inside" nl);
stdout.puts("these caves, only to be disturbed by your species which" nl);
stdout.puts("pollute this landscape! I was once happy in my silence" nl);
stdout.puts("here, yet you come to make me miserable! I won't allow" nl);
stdout.puts("it, knave! Prepare to feel my wrath!!!'" nl);
// ------------------------------------------------------
// Change foreground color to cyan, background to blue.
// ------------------------------------------------------
console.setAttrs( console.cyan, console.blue );
// ------------------------------------------------------
// Use "stdout.puts" to display a brief message.
// ------------------------------------------------------
stdout.puts("The dragon moves about angrily, stomping the floor!" nl);
// ------------------------------------------------------
// Change foreground color to white, background to blue.
// ------------------------------------------------------
console.setAttrs( console.white, console.blue );
// ------------------------------------------------------
// Use "stdout.puts" to display another message.
// ------------------------------------------------------
stdout.puts("What now, adventurer?" nl);
// ------------------------------------------------------
// End the program. Total lines: 75. Bytes: 3,895.
// ------------------------------------------------------
end west;
What this program does is change the background color of the screen to blue, setting various other color registers to green, yellow, cyan and white. It then outputs text to the screen via the command stdout.puts, which is similar to how C++ handles string output. Also, notice the use of nl at the end of some lines. This stands for next line, moving the cursor one line down, like a carriage return.
This simple example shows a limited subset of the entire HLA Standard Library, which incorporates everything from file I/O to popping the stack, switching register values and other traditional assembly language commands. With a larger understanding of HLA, it is possible to write almost anything in HLA, including versions of HLA itself.
HLA also can use a variety of freeware and shareware assemblers, such as MASM, FASM and Gas. For those curious, assemblers are tools that help create binary files, which then can run independent of HLA. The best part about HLA is it is a constantly evolving programming language. In fact, HLA will soon reach version 2.0. This version is reported to be significantly faster than current versions. For now, version 1.76 of HLA is available freely from Hyde's Web site. HLA can be installed under Linux after reading the HLA Installation Guide.
HLA is a robust, complete programming language. As Hyde has written:
The HLA (High Level Assembly) language was developed as a tool to help teach assembly language programming and machine organization to University students at the University of California, Riverside. The basic idea was to teach students assembly language programming by leveraging their knowledge of high level languages like C/C++ and Pascal /Delphi. At the same time, HLA was designed to allow advanced assembly language programmers write more readable and more powerful assembly language code.
For Linux users, HLA is a strong programming tool that allows them to create powerful programs on a variety of different levels. As HLA becomes more feature-rich, additional applications will be written using HLA under Linux. With HLA and Linux, programmers can develop new and exciting applications anyone can use.
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Sponsored by AMD
Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6
Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.
Learn more about catching the bad guy in this free white paper.
Sponsored by DLT Solutions
| Dynamic DNS—an Object Lesson in Problem Solving | May 21, 2013 |
| Using Salt Stack and Vagrant for Drupal Development | May 20, 2013 |
| Making Linux and Android Get Along (It's Not as Hard as It Sounds) | May 16, 2013 |
| Drupal Is a Framework: Why Everyone Needs to Understand This | May 15, 2013 |
| Home, My Backup Data Center | May 13, 2013 |
| Non-Linux FOSS: Seashore | May 10, 2013 |
- RSS Feeds
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Using Salt Stack and Vagrant for Drupal Development
- Dynamic DNS—an Object Lesson in Problem Solving
- New Products
- Validate an E-Mail Address with PHP, the Right Way
- Drupal Is a Framework: Why Everyone Needs to Understand This
- A Topic for Discussion - Open Source Feature-Richness?
- Download the Free Red Hat White Paper "Using an Open Source Framework to Catch the Bad Guy"
- Tech Tip: Really Simple HTTP Server with Python
- myip
21 min 21 sec ago - Keeping track of IP address
2 hours 12 min ago - Roll your own dynamic dns
7 hours 25 min ago - Please correct the URL for Salt Stack's web site
10 hours 37 min ago - Android is Linux -- why no better inter-operation
12 hours 52 min ago - Connecting Android device to desktop Linux via USB
13 hours 21 min ago - Find new cell phone and tablet pc
14 hours 19 min ago - Epistle
15 hours 47 min ago - Automatically updating Guest Additions
16 hours 56 min ago - I like your topic on android
17 hours 43 min ago
Enter to Win an Adafruit Pi Cobbler Breakout Kit for Raspberry Pi

It's Raspberry Pi month at Linux Journal. Each week in May, Adafruit will be giving away a Pi-related prize to a lucky, randomly drawn LJ reader. Winners will be announced weekly.
Fill out the fields below to enter to win this week's prize-- a Pi Cobbler Breakout Kit for Raspberry Pi.
Congratulations to our winners so far:
- 5-8-13, Pi Starter Pack: Jack Davis
- 5-15-13, Pi Model B 512MB RAM: Patrick Dunn
- 5-21-13, Prototyping Pi Plate Kit: Philip Kirby
- Next winner announced on 5-27-13!
Free Webinar: Hadoop
How to Build an Optimal Hadoop Cluster to Store and Maintain Unlimited Amounts of Data Using Microservers
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Some of key questions to be discussed are:
- What is the “typical” Hadoop cluster and what should be installed on the different machine types?
- Why should you consider the typical workload patterns when making your hardware decisions?
- Are all microservers created equal for Hadoop deployments?
- How do I plan for expansion if I require more compute, memory, storage or networking?



Comments
Hla is my first gate to the
Hla is my first gate to the real asm, I like it.
THX for developing such tool.
HLA Programming
The useful tool for training and creation of the applications.
What's the point of all this?
What's the point of all this? Real assembly language programmers don't need C++ style crutches (which is what HLA looks like) and unless one is prepared to fully understand the underlying machine architecture, one will *NEVER* be any good at assembly language.
As for not having to deal with individual MPU instructions, memory management, chip registers, etc., that's where the challenge in assembly language lies. Take that stuff out and you just have yet another weird language.
HLA is far more robust than what was described...
...in the article. It can use assembly commands like MOV, ADD, SUB, etc. It can even make calls to the BIOS. HLA is a mixture of Pascal, C/C++ and Assembly, but by and large it is a High Level Assembly programming language. Some would call it an HLL Pre-parser, but I don't.
Paul
Your article re. HLA ...
Just like to add, for the sake of any ol'timers out there who recall those fun and heady days of the C64 ... (it was a big hit in Toronto and all Canada ... and then TPUG and Comal for the C64 ...) and then the IBM Comal 80 ...
Users groups were THEN fun and exciting for students, young and old a like ...
Well HLA, for me, brings that back ... even better ... you can download it free ... and it assembles into 32 bit machine code ... which is MUCH more compact the any C++ stuff I've compiled ... and REALLY flies. It is very well structured like C++, or Pacsal (as C64 Comal and Comal 80 was ) and you have (a) great library(s) to draw from ... and of course you can make and reuse all your procedures ... (Many users freely share their procedures too.)
And Bonus! What you write in HLA will compile under HLA for Windows as well as HLA for Linux!
(And of course, you can learn a lot about the hardware too.)
And MOST amazingly, you have a very experienced and capable, but humble and approachable and very helpful teacher and author to correspond with on line, in the person of Randall Hyde !!!
Since HLA and so much online stuff is free to download, this also makes it very easy on your (student) budget!
David