The application relates to an interrupt or exception event
processing method, a processor and an electronic device. The method comprises the following steps: after an interrupt or exception event is detected by a write-back unit, flushing a pipeline and triggering a hardware stack operation; based on the stack operation, a microinstruction splitting unit splits a stack microinstruction sequence of the hardware stack to obtain a register stack switching instruction while a fetch unit sequentially obtains to-be-processed instructions; the microinstruction splitting unit switches a first register stack currently used to a second register stack based on the register stack switching instruction; and sends to-be-executed instructions to an
execution unit; the
execution unit executes the to-be-executed instructions to perform interrupt or exception
processing, and stores intermediate data and / or result data generated after execution to the second register stack. The first register stack and the second register stack are physically isolated in the processor, and a microinstruction splitting mechanism automatically triggered by hardware is combined, so that an interrupt or exception
processing flow is significantly optimized.