Assembly language-internal interrupt

      Any general-purpose CPU has the ability to detect a kind of special information sent from outside or internally generated by the CPU after executing the instructions currently being executed, and can immediately perform processing on the received information deal with. We can call this special information: interrupt information. Interruption means that the CPU will no longer continue (the instruction that has just been executed) down, but will instead process this special information.

Interrupt information can come from inside and outside the CPU (internal interrupt, external interrupt)

Internal interrupt: When something needs to be processed inside the CPU, an interrupt message will be generated and the interrupt process will be triggered. This kind of interrupt information comes from inside the CPU

8086CPU internal interrupt (the following four situations will generate interrupt information)

       Division error, for example, division overflow caused by executing the div instruction;

       Single step

       Execute into instruction;

       Execute the int instruction.

The interrupt information contains the interrupt type code. The interrupt type code is a byte data, which can indicate the source of 256 types of interrupt information (interrupt source)

For the above four interrupt sources, the interrupt type codes in 8086CPU are as follows.

      Division error: 0

      Single step: 1

      Execute into instruction: 4

      Execute the int instruction, the format of the instruction is int n, the n in the instruction is a byte type immediate value, which is the interrupt type code provided to the CPU

 

Reference: <<Assembly Language>> Wang Shuang

Guess you like

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