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


from .zlogging import log
    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)
        raise ZStackError
      self.start_addr += 1

      # Initialize the local vars in the ZRoutine's dictionary. This is
      # only needed on machines v1 through v4. In v5 machines, all local
      # variables are preinitialized to zero.
      self.local_vars = [0 for _ in range(15)]
      if 1 <= zmem.version <= 4:
        for i in range(num_local_vars):
          self.local_vars[i] = zmem.read_word(self.start_addr)
          self.start_addr += 2
      elif zmem.version != 5:
        raise ZStackUnsupportedVersion

    # Place call arguments into local vars, if available
    for i in range(0, len(args)):
      self.local_vars[i] = args[i]


  def pretty_print(self):
    "Display a ZRoutine nicely, for debugging purposes."

    log("ZRoutine:        start address: %d" % self.start_addr)
    log("ZRoutine: return value address: %d" % self.return_addr)

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


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

    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)
        raise ZStackError
      self.start_addr += 1

      # Initialize the local vars in the ZRoutine's dictionary. This is
      # only needed on machines v1 through v4. In v5 machines, all local
      # variables are preinitialized to zero.
      self.local_vars = [0 for _ in range(15)]
      if 1 <= zmem.version <= 4:
        for i in range(num_local_vars):
          self.local_vars[i] = zmem.read_word(self.start_addr)
          self.start_addr += 2
      elif zmem.version != 5:
        raise ZStackUnsupportedVersion

    # Place call arguments into local vars, if available
    for i in range(0, len(args)):
      self.local_vars[i] = args[i]


  def pretty_print(self):
    "Display a ZRoutine nicely, for debugging purposes."

    log("ZRoutine:        start address: %d" % self.start_addr)
    log("ZRoutine: return value address: %d" % self.return_addr)

    log("ZRoutine:      program counter: %d" % self.program_counter)