# Path: zvm/zlogging.py
# def log(msg):
#   mainlog.debug(msg)


from .zlogging import log
  pass

class ZStackPopError(ZStackError):
  "Nothing to pop from stack!"
  pass

# Helper class used by ZStackManager; a 'routine' object which
# includes its own private stack of data.
class ZRoutine(object):

  def __init__(self, start_addr, return_addr, zmem, args,
               local_vars=None, stack=None):
    """Initialize a routine object beginning at START_ADDR in ZMEM,
    with initial argument values in list ARGS.  If LOCAL_VARS is None,
    then parse them from START_ADDR."""

    self.start_addr = start_addr
    self.return_addr = return_addr
    self.program_counter = 0    # used when execution interrupted

    if stack is None:
      self.stack = []
    else:
      self.stack = stack[:]

    if local_vars is not None:
      self.local_vars = local_vars[:]
    else:
      num_local_vars = zmem[self.start_addr]
      if not (0 <= num_local_vars <= 15):

# Path: zvm/zlogging.py
# def log(msg):
#   mainlog.debug(msg)


# Path: zvm/zstackmanager.py
from .zlogging import log

  pass

class ZStackPopError(ZStackError):
  "Nothing to pop from stack!"
  pass

# Helper class used by ZStackManager; a 'routine' object which
# includes its own private stack of data.
class ZRoutine(object):

  def __init__(self, start_addr, return_addr, zmem, args,
               local_vars=None, stack=None):
    """Initialize a routine object beginning at START_ADDR in ZMEM,
    with initial argument values in list ARGS.  If LOCAL_VARS is None,
    then parse them from START_ADDR."""

    self.start_addr = start_addr
    self.return_addr = return_addr
    self.program_counter = 0    # used when execution interrupted

    if stack is None:
      self.stack = []
    else:
      self.stack = stack[:]

    if local_vars is not None:
      self.local_vars = local_vars[:]
    else:
      num_local_vars = zmem[self.start_addr]
      if not (0 <= num_local_vars <= 15):

        log("num local vars is %d" % num_local_vars)