def str_list(data_in, mode=0):
    """
    mode 0: splits an ascii string and adds elements to a list.
    mode 1: converts list elements to ascii characters and joins them.
    """
    if mode == 0:
        data_out = []
        for i in range(len(data_in)):
            data_out.append(ord(data_in[i]))  # chr and ord functions for ascii conversions
        return data_out
    data_out = ''
    for i in range(16):
        data_out += chr(data_in[i])
    return data_out