generating code for read, write, and assign