code: def compileThreeAddrForm(program):
      
  
      def nToChr(reg):
          if reg is None:
              return b'\xff'
          elif reg.n < 0:
              raise ValueError("negative value for register number %s" % reg.n)
          else:
              if sys.version_info[0] < 3:
                  return chr(reg.n)
              else:
                  # int.to_bytes is not available in Python < 3.2
                  #return reg.n.to_bytes(1, sys.byteorder)
                  return bytes([reg.n])
  
      def quadrupleToString(opcode, store, a1=None, a2=None):
          cop = chr(interpreter.opcodes[opcode]).encode('ascii')
          cs = nToChr(store)
          ca1 = nToChr(a1)
          ca2 = nToChr(a2)
          return cop + cs + ca1 + ca2
  
      def toString(args):
          while len(args) < 4:
              args += (None,)
          opcode, store, a1, a2 = args[:4]
          s = quadrupleToString(opcode, store, a1, a2)
          l = [s]
          args = args[4:]
          while args:
              s = quadrupleToString(b'noop', *args[:3])
              l.append(s)
              args = args[3:]
          return b''.join(l)
  
      prog_str = b''.join([toString(t) for t in program])
      return prog_str
docs: Given a three address form of the program, compile it a string that
      the VM understands.