Higher level code for external memory r/w