ToDone: moved sys call handler out of Emulatedthread.cpp