fork from https://github.com/ntu-android/simple_vm