Compile code for read and write