def cut_to_pages(h, pgsz):
    """Cut each data block to pages.
    
    Args:
        h (list): response from `asaloader.ihex.padding_space`.
        pgsz (int): page size, e.g. 256, 512.
    
    Returns:
        list: data pages
    """
    res = []
    for sect in h:
        sect_addr = sect['address']
        sect_data = sect['data']
        for i in range(len(sect_data) // pgsz):
            res += [{'address': sect_addr + i * pgsz, 'data': sect_data[i *
                pgsz:i * pgsz + pgsz]}]
    return res
