Module: Gruesome

Defined in:
lib/gruesome/logo.rb,
lib/gruesome.rb,
lib/gruesome/cli.rb,
lib/gruesome/machine.rb,
lib/gruesome/z/zscii.rb,
lib/gruesome/z/header.rb,
lib/gruesome/z/memory.rb,
lib/gruesome/z/opcode.rb,
lib/gruesome/z/decoder.rb,
lib/gruesome/z/machine.rb,
lib/gruesome/z/processor.rb,
lib/gruesome/z/dictionary.rb,
lib/gruesome/z/instruction.rb,
lib/gruesome/z/object_table.rb,
lib/gruesome/z/opcode_class.rb,
lib/gruesome/z/operand_type.rb,
lib/gruesome/z/abbreviation_table.rb

Overview

The stack is weird. Every function call starts with an empty stack and any work left in the stack upon a return is lost. So there are actually many stacks… one stack to hold the stacks in play, and a stack for each active function.

The stack holds the return address and the (up to) 15 local variables for the routine as accessed by variables %01 to %0f.

Variable %00 is the top of the stack, writing to it pushes, reading from it pulls.

Illegal access to variables will halt the machine. Such as illegally accessing local variables that do not exist as the routine header will specify an exact number.

Defined Under Namespace

Modules: Logo, Z Classes: CLI, Machine

Class Method Summary collapse

Class Method Details

.execute(story_file) ⇒ Object



4
5
6
# File 'lib/gruesome.rb', line 4

def Gruesome.execute(story_file)
  Machine.new(story_file).execute
end