Microprocessor Simulator 0 Help



Download 1.18 Mb.
Page58/82
Date18.03.2021
Size1.18 Mb.
#56105
1   ...   54   55   56   57   58   59   60   61   ...   82
sms32v50 (3)
sms32v50 (3), sms32v50 (6)

Calling an Interrupt


This is quite complex. The command INT 02 causes the CPU to retrieve the contents of RAM location 02. After saving the return address onto the stack, the instruction pointer IP is set to this address.

The interrupt code is then executed. When complete the IRET command causes the return from the interrupt. The CPU instruction pointer IP is set to the address that was saved onto the stack earlier.


Trapping an Interrupt


If you wan to trap interrupt 02, change the address stored at address 02 to point to code that you have written. Your code will then handle the interrupt. When complete, your code can use IRET to return from the interrupt or it can jump to the address that was originally in address 02. This causes the original interrupt code to be executed as well. In this way, you can replace or modify the behaviour of an interrupt.



Download 1.18 Mb.

Share with your friends:
1   ...   54   55   56   57   58   59   60   61   ...   82




The database is protected by copyright ©ininet.org 2024
send message

    Main page