The Glulx VM reference interpreter
C Python Objective-C Makefile
Latest commit 1b42cb8 Aug 23, 2016 Andrew Plotkin README.
Failed to load latest commit information.
.gitignore Added a .gitignore. Mar 22, 2009
Makefile Adds defaults for gtkglk. Jun 28, 2014
README README. Aug 23, 2016
accel.c Full stashing of the acceleration_func table. Feb 27, 2016
exec.c An option to let write-to-zero pass (for the @glk opcode). Aug 23, 2016
files.c Release 0.4.3. Mar 22, 2009
float.c Added an option to *not* assume IEEE-754 native floats. Aug 2, 2010
funcs.c Record stack information in profiling. Jan 4, 2011
gestalt.c Putting arguments on the macros is silly. Sep 24, 2014
gestalt.h Started adding the floating-point opcodes. Jul 21, 2010
glkop.c Put in some defensive checks for missing Glk objects. I'm not sure this Sep 28, 2014
glulxdump.c Brought the opcode table up to date. However, the disassembler is sti… Jan 15, 2012
glulxe.h An option to let write-to-zero pass (for the @glk opcode). Aug 23, 2016
heap.c Removed a bunch of unused variables that never bothered me before. Apr 30, 2011
iosstart.h Add an object for storing accel entries. Feb 27, 2016
iosstart.m Full stashing of the acceleration_func table. Feb 27, 2016
macstart.c Release 0.3.4. Mar 22, 2009
main.c Hook for autorestore. Sep 9, 2012
opcodes.h Started adding the floating-point opcodes. Jul 21, 2010
operand.c Putting arguments on the macros is silly. Sep 24, 2014
osdepend.c Abstracted powf() to an osdepend wrapper. (Needed for Windows.) Aug 24, 2010 More comments. Jul 17, 2016
profile.c @restore and @restoreundo should fail (rather than fatalerror out) Aug 23, 2016
search.c Removed unnecessary include. Jan 4, 2011
serial.c @restore and @restoreundo should fail (rather than fatalerror out) Aug 23, 2016
string.c Removed a bunch of unused variables that never bothered me before. Apr 30, 2011
unixstrt.c Start rigging up call-count profiling. Jul 31, 2014
vm.c Load memory in 256-byte chunks, because why rely on OS stream buffering? Oct 15, 2014
winstart.c Bumped version number for 0.4.7 release. Oct 10, 2011


Glulxe: the Glulx VM interpreter
Version 0.5.2

    Designed by Andrew Plotkin <>

* Compiling

Since this is a Glk program, it must be built with a Glk library. See
the Glk home page at

The Unix Makefile that comes with this package is designed to link any
of the Unix libraries (GlkTerm and CheapGlk.) You'll have to go into
the Makefile and set three variables to find the library. There are
instructions at the top of the Makefile. Then just type

    make glulxe

That should suffice. When the program is built, type

    ./glulxe filename.ulx

where "filename.ulx" is a Glulx game file to execute.

To build this program with a Mac or Window interface, you'll need the
appropriate Glk library.

This program supports floating-point operations, which are implemented
using the standard C99 math functions. The Makefile uses "-lm" to link
these in. If your platform does not support these functions, you can
comment out the "#define FLOAT_SUPPORT" line in glulxe.h.

* Version

0.5.3 (###):
    Turn on SERIALIZE_CACHE_RAM in the default build. This speeds up
    save and save-undo operations.
    Other tweaks to speed up launch, restart, restore, etc.
    Fixed a bug where accelerated functions were not being autosaved.
    (Only relevant for iOS, currently.)
    When profiling, restore/restore-undo operations will now fail
    (and the game will continue) instead of causing a fatal error.
    Added a build option to tolerate the Superglus bug where (very old)
    game files would try to write to memory address zero.

0.5.2 (Mar 27, 2014):
    Added acceleration functions 8 through 13, which work correctly when
    NUM_ATTR_BYTES is changed.

0.5.1 (Mar 10, 2013):
    Fixed a bug in glkop.c that prevented get_buffer_stream() from
    working right.
    Updated to understand the upcoming, updated I6
    debug file format. (See
    The old format is still supported.

0.5.0 (Oct 18, 2012):
    Turned on memory-range checking in the default build. (Should have
    done this years ago.)
    Fixed a bug where @setmemsize could crash an open char memory stream
    or char line input request.
    Updated glkop.c to handle arrays of Glk objects. (This is needed to
    support glk_schannel_play_multi().)
    Added hooks for the library to execute at startup and select time.
    Added a hook which allows the library to get and pass on a game ID
    Clean up all memory allocation when the VM exits.

0.4.7 (Oct 10, 2011):
    Abstracted powf() to an osdepend wrapper. (Needed for Windows.)
    Fixed a @ceil bug, for some C math libraries.
    Improved the profiling system in several ways.
    Fixed a bug in glkop.c dispatching, to do with optional array

0.4.6 (Aug 17, 2010):
    Added floating-point math feature.
    Updated winstart.c. (Thanks David Kinder.)
    Fixed @random even more, on Windows.
    @verify works right on game files with extended memory.
    @getiosys works right when the two store operands are different
    variable types. (E.g., one local and one global.)

0.4.5 (Nov 23, 2009):
    VERIFY_MEMORY_ACCESS now detects writes to the ROM section of memory.
    Fixed off-by-eight bug in @astorebit and @aloadbit with negative bit
    Fixed an obscure bug with division and modulo of $80000000. (Thanks 
    Evin Robertson.)
    Fixed an extremely obscure problem with changing I/O mode in the middle
    of printing a number.
    Glk array/string operations are now checked for memory overflows
    (though not for ROM writing). This generates a warning at present;
    in the future, it will be a fatal error.
    Better fix for the @random bug.

0.4.4 (Mar 11, 2009):
    Added profiling code, which is turned off by default. To compile it 
    in, define VM_PROFILING in Makefile or in glulxe.h.
    Added function-accleration feature.
    Fixed bug where @random 0 was returning only positive numbers.

0.4.3 (Jan 23, 2008):
    Verify the presence of Unicode calls in the Glk library at runtime.
    (Thanks Simon Baldwin.)
    Added a compile-time option to check for invalid memory accesses.
    (This is slower, but safer. Define VERIFY_MEMORY_ACCESS in Makefile
    or in glulxe.h. Thanks Evin Robertson.)
    Fixed a memory leak of undo states. (Thanks Matthew Wightman.)
    Fixed a linked-list handling error for Glk unicode arrays. (Thanks
    David Kinder.)

0.4.2 (Feb 15, 2007):
    Fixed a bug that preventing compiling with old (pre-Unicode) Glk

0.4.1 (Feb 11, 2007):
    Added array copy and heap allocation functionality. (Glulx spec 

0.4.0 (Aug 13, 2006):
    Added Unicode functionality. (Glulx spec 3.0.0.)

0.3.5 (Aug 24, 2000):
    Fixed El-Stupido bug in the modulo opcode.

0.3.4 (Jul 11, 2000):
    Finally supports string arguments to Glk calls.

0.3.3 (Mar 29, 2000):
    Added setiosys, getiosys opcodes.
    Fixed bug in binarysearch.

0.3.2 (Feb 21, 2000):
    Added search, jumpabs, callf, and gestalt opcodes.

0.3.1 (Aug 23, 1999):
    Startup code now handles Blorb files correctly.

0.3.0 (Aug 17, 1999):
    Added support for compressed strings.

0.2.2 (Jun 15, 1999):
    Another pre-release version.

0.2.0 (May 30, 1999):
    A pre-release version.

* Permissions

The source code in this package is copyright 1999-2012 by Andrew Plotkin.
You may copy and distribute it freely, by any means and under any conditions,
as long as the code and documentation is not changed. You may also
incorporate this code into your own program and distribute that, or modify
this code and use and distribute the modified version, as long as you retain
a notice in your program or documentation which mentions my name and the
URL shown above.