Assembly language --iret instruction

      The CPU may execute the interrupt handler at any time. The interrupt handler must always be stored in a certain space in the memory.
The entry address of the interrupt handler, that is, the interrupt vector, must be stored in the corresponding interrupt vector table entry.

General writing steps of interrupt handler:

  1. Save the used registers;
  2. Processing interrupt
  3. Restore the used registers;
  4. Use the iret command to return.

The iret instruction is described as: pop IP pop CS popf

After the iret instruction is executed, the CPU returns to the execution point before executing the interrupt handler to continue executing the program

Guess you like

Origin blog.csdn.net/ma2595162349/article/details/108564513