Make a subfunction and fill out all memory except CSR.