A generic emulator for simple processors