rewrote memreglock now it really works
memwrite and regwrite locks for the same amount of time 3 cycles