Microprocessor Simulator 0 Help


Interrupts and Procedures



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

Interrupts and Procedures


Interrupts are short code fragments that provide useful services that can be used by other programs. Typical routines handle key presses, mouse movements and button presses, screen writing, disk reading and writing and so on.

An interrupt is like a procedure but it is called in a different way. Procedures are called by jumping to the start address of the procedure. This address is known only to the program that owns the procedure. Interrupts are called by looking up the address of the interrupt code in a table of interrupt vectors. The contents of this table is published and widely known. MS DOS makes heavy use of interrupts for all its disk, screen, mouse, network, keyboard and other services.

By writing your own code and making the interrupt vector point to the code you wrote, the behaviour of interrupts can be completely altered. Your interrupt code might add some useful behaviour and then jump back to the original code to complete the work. This is called TRAPPING the interrupt.

Software interrupts are triggered, on demand, by programs.

Hardware interrupts are triggered by electronic signals to the CPU from hardware devices.


Download 1.18 Mb.

Share with your friends:
1   ...   52   53   54   55   56   57   58   59   ...   82




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

    Main page