factor out memory accesses by CPU to common block to keep logic
simple.