Flag register added in cpu states
Add rw function
Add test for rw function