TOC PREV NEXT INDEX

Put your logo here!


8 Installing HLA Under Windows


New Easy Installation:

As of HLA v1.58, you can find a program titled "hlasetup.exe" on Webster. Running this application automatically installs HLA on your system. You must first install MASM32 (described below) and then run hlasetup.exe. That's all there is to it. Those who wish to exercise complete control over the placement of the HLA executables can still choose to manually install HLA, but this is not recommended for first-time users.

Original Manual Installation:

HLA can operate in one of several modes. In the standard mode it converts an HLA source file directly into an object file like most assemblers. In other modes, it has the ability to translate HLA source code into another source form that is compatible with several other assemblers, such as MASM, TASM, FASM, and Gas. A separate assembler, such as MASM, can compile that low-level intermediate code to produce an object code file. Strictly speaking, this step (converting to a low-level assembler format and assembling via MASM/FASM/GASM/Gas is not necessary, but there are some times when it's advantageous to work in this manner. Finally, you must link the object code output from the assembler using a linker program. Typically you will link the object code produced by one or more HLA source files with the HLA Standard Library (hlalib.lib) and, possibly, several operating system specific library files (e.g., kernel32.lib under Win32). Most of this activity takes place transparently whenever you ask HLA to compile your HLA source file(s). However, for the whole process to run smoothly, you must have installed HLA and all the support files correctly. This section will discuss how to set up HLA on your system.

First, you will need an HLA distribution for your particular Operating System. These instructions describe installation under Windows; see the next section if you're using Linux. The latest version of HLA is always available on Webster at http://webster.cs.ucr.edu. You should go there and download the latest version if you do not already possess it.

The HLA package contains the HLA compiler, the HLA Standard Library, and a set of include files for the HLA Standard Library. It also includes copies of the FASM assembler, the Pelles C librarian and linker, and some other tools. These tools will let you produce executable files under Windows and Linux. However, it's still a good idea for Windows' users to grab a copy of the MASM assembler and linker. The easiest way to get all the MASM files you need is to download the "MASM32" package from http://www.pdq.com.au/home/hutch/masm.htm or any of the other places on the net where you can find the MASM32 package. Once you unzip this file, it's easy to install the MASM32 package using the install program it supplies.

Here are the steps I went through to install MASM32 on my system:


 
path=c:\hla;c:\masm32\bin;%path%
 
set lib=c:\masm32\lib;c:\hla\hlalib;%lib%
 


 
program HelloWorld;
 
#include( "stdlib.hhf" )
 
begin HelloWorld;
 

 
	stdout.put( "Hello, World of Assembly Language", nl );
 

 
end HelloWorld;
 

 

 
HLA (High Level Assembler)
 
Released to the public domain by Randall Hyde.
 
Version Version 1.59 build 8109 (prototype)
 

 
Files:
 
1: hw.hla
 

 
Compiling "hw.hla" to "hw.asm"
 

 
Assembling hw.asm via "ml /c /coff /Cp  hw.asm"
 

 
Microsoft (R) Macro Assembler Version 6.14.8444
 
Copyright (C) Microsoft Corp 1981-1997. All rights reserved.
 

 
 Assembling: hw.asm
 
Linking via "link -subsystem:console  /heap:0x1000000,0x1000000 /stack:0x1000000,0x1000000 
/BASE:0x3000000 /machine:IX86  -entry:?HLAMain @hw.link  -out:hw.exe kernel32.lib user32.lib  
c:\hla\hlalib\hlalib.lib hw.obj"
 
Microsoft (R) Incremental Linker Version 5.12.8078
 
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.
 

 
/section:.text,ER 
 
/section:readonly,R 
 
/section:.edata,R 
 
/section:.data,RW 
 
/section:.bss,RW 
 

 

Manually installing HLA is a complex and slightly involved process. Fortunately, the hlasetup.exe program automates almost everything so that you don't have to worry about changing registry settings and things like that. If you're a first-time HLA user, you definitely want to use this method to install HLA. Manual installation is really intended for upgrades as new versions of HLA appear. You do not have to change the environment variables to install a new version of HLA, simply extract the executable files over the top of your existing installation and everything will work fine.

The most common two problems people have running HLA involve the location of the Win32 library files and the choice of linker. During the linking phase, HLA (well, link.exe actually) requires the kernel32.lib, user32.lib, and gdi32.lib library files. These must be present in the pathname(s) specified by the LIB environment variable. If, during the linker phase, HLA complains about missing object modules, make sure that the LIB path specifies the directory containing these files. If you're a MS VC++ user, installation of VC++ should have set up the LIB path for you. If not, then locate these files (they are part of the MASM32 distribution) and copy them to the HLA\HLALIB directory (note that the ihla.bat file includes c:\hla\hlalib as part of the LIB path).

Another common problem with running HLA is the use of the wrong link.exe program. Microsoft has distributed several different versions of link.exe; in particular, there are 16-bit linkers and 32-bit linkers. You must use a 32-bit segmented linker with HLA. If you get complaints about "stack size exceeded" or other errors during the linker phase, this is a good indication that you're using a 16-bit version of the linker. Obtain and use a 32-bit version and things will work. Don't forget that the 32-bit linker must appear in the execution path (specified by the PATH environment variable) before the 16-bit linker.

For more information, please see the sections on HLA Internal Operation and Customizing HLA.



TOC PREV NEXT INDEX