add tests; add global variable r8; change sequence of usermode switching and stack transfering