def assemble
      location = 0
      @labels  = {}
      @body    = []

      lines.each do |line|
        # Set label location
        @labels[line.label] = location if line.label

        # Skip when no op
        next if line.op.empty?

        op = Instruction.create(line.op, line.args, location)
        @body << op
        location += op.size
      end

      # Apply labels
      begin
        @body.each { |op| op.apply_labels(@labels) }
      rescue Exception => e
        puts @labels.inspect
        raise e
      end
    end
def assemble
      location = 0
      @labels  = {}
      @body    = []

      lines.each do |line|
        # Set label location
        @labels[line.label] = location if line.label

        # Skip when no op
        next if line.op.empty?

        op = Instruction.create(line.op, line.args, location)
        @body << op
        location += op.size
      end

      # Apply labels
      begin
        @body.each { |op| op.apply_labels(@labels) }
      rescue Exception => e
        puts @labels.inspect
        raise e
      end
    end
Assemble the given input.