[REFACTORING] WRITEMEM/READMEM macros added