x86: implement exception handling