

NAME
	GL-Assembler
	By Andrew Brault (ajb@wpi.edu) 1996

	This software is being distributed under
	the GNU Public Licence.  For details see
	the file COPYING.


DESCRIPTION
	This is a portable assembler for the HP48 "GL" package
	by Erik Bryntse.  It works on MS-DOS and should work
	on any Unix platform (it is guaranteed to work on a
	Linux system, since that's where I developed it).

	For your convenience, a MS-DOS executable is included
	in this package.  It is named GLASS.EXE and makes a good
	replacement for that awful PCMAC assembler distributed
	with the GL package.

	For information on the GL language please get the
	GL package from any of the major HP48 ftp sites.
	It's usually available under a "games" directory by
	the name of gl.zip, gl11.zip, etc.

	I'd be interested in any comments, questions, etc. you
	have about this program.  Please send e-mail to ajb@wpi.edu. 

	
COMPILING
	Unix:	Edit the Makefile, if necessary.  Type `make'
		from the commandline to compile.  If you get
		errors about `strcasecmp' you need to change
		the define STRCASECMP in main.h to something
		appropriate for your system (hint: on MS-DOS
		this is usually "stricmp").

		Note that if you want to modify the parser you
		will need a copy of lex and yacc to recompile
		the files parse.y and scan.l.

	MS-DOS: A pre-built executable is available in the
		file GLASS.EXE.

	VMS:	CC all source files, then LINK them all together.


USAGE
	Assuming your GL source file is in "myprog.gl",
	the following command will assemble the source and
	write it to the file "myprog.bin":

	      glass myprog.gl myprog.bin

	Of course, you can name your files differently.  There
	are no forced conventions on filename extensions, etc.

	There are no "switches" or "options" to provide to the
	assembler.  The only way to use the program is:

              glass [input file] [output file]


SAMPLE PROGRAMS
        There are a few sample programs in this package that
	you can assemble and download to your HP48:

	From the original GL distribution:
	     dball.gl   -- breakout-style game
	     prime.gl   -- prime number program
	     sp.gl      -- spaceship game
	     tron.gl    -- generic 2 player tron clone 

	New in this package (written by me):
	     defend.gl  -- not complete, but works
	     doodle.gl  -- simple drawing program
	     game.gl    -- grab the numbers game, pretty good
	     hop.gl     -- try to stay on a moving platform


FEATURES
	Supports the algebraic operators:
		 + - / * % ^ & |

	Unary minus is NOT supported (no true negative numbers
	in GL!)

	Allows reversing the order of operands for instructions
	such as BGT, BLE, etc.  (if you are familiar with GL you
	will know what this means.)
	
	Automatically detects when relative jumps go too far and
	gives you an appropriate error message.

	For efficiency, makes only a single pass over the source
	text.


CAVEATS
	If you assemble a source file you obtained from somewhere
	else and get the message `Syntax error near "#"', remove
	the "#lib" declaration at the top of the source file.
	This declaration is required by the PCMAC assembler
	originally distributed with GL.

	Because of the way the parser works, your source file must
	end with a newline (or you will get a syntax error at
	the end of the file).

	
BUGS
	Sometimes common errors will be reported as "internal
	errors".  They rarely actually are.

	Error handling in general needs improvement, but it's better
	than nothing, and at least you get line numbers.
	
		
	      
	

