memory refactoring (mostly for cd) + ARM mem asm update