參數(shù)資料
型號(hào): DM6806
廠商: Electronic Theatre Controls, Inc.
英文描述: DM5806 DATA MODULE DIGITAL I/O BOARD
中文描述: DM5806數(shù)據(jù)模塊數(shù)字I / O板
文件頁(yè)數(shù): 42/64頁(yè)
文件大?。?/td> 270K
代理商: DM6806
4-12
interrupt controller checks to see if interrupts are enabled for that IRQ, and then checks to see if other interrupts are
active or requested and determines which interrupt has priority. The interrupt controller then interrupts the proces-
sor. The current code segment (CS), instruction pointer (IP), and flags are pushed on the stack for storage, and a new
CS and IP are loaded from a table that exists in the lowest 1024 bytes of memory. This table is referred to as the
interrupt vector table and each entry is called an interrupt vector. Once the new CS and IP are loaded from the
interrupt vector table, the processor begins executing the code located at CS:IP. When the interrupt routine is
completed, the CS, IP, and flags that were pushed on the stack when the interrupt occurred are now popped from the
stack and execution resumes from the point where it was interrupted.
- Using Interrupts in Your Programs
Adding interrupts to your software is not as difficult as it may seem, and what they add in terms of performance
is often worth the effort. Note, however, that although it is not that hard to use interrupts, the smallest mistake will
often lead to a system hang that requires a reboot. This can be both frustrating and time-consuming. But, after a few
tries, you’ll get the bugs worked out and enjoy the benefits of properly executed interrupts.
- Writing an Interrupt Service Routine (ISR)
The first step in adding interrupts to your software is to write the interrupt service routine (ISR). This is the
routine that will automatically be executed each time an interrupt request occurs on the specified IRQ. An ISR is
different than standard routines that you write. First, on entrance, the processor registers should be pushed onto the
stack
BEFORE
you do anything else. Second, just before exiting your ISR, you must clear the interrupt status of
the DM5806 and write an end-of-interrupt command to the 8259 controller. Finally, when exiting the ISR, in
addition to popping all the registers you pushed on entrance, you must use the IRET instruction and
not
a plain
RET. The IRET automatically pops the flags, CS, and IP that were pushed when the interrupt was called.
If you find yourself intimidated by interrupt programming, take heart. Most Pascal and C compilers allow you
to identify a procedure (function) as an interrupt type and will automatically add these instructions to your ISR, with
one important exception: most compilers
do not
automatically add the end-of-interrupt command to the procedure;
you must do this yourself. Other than this and the few exceptions discussed below, you can write your ISR just like
any other routine. It can call other functions and procedures in your program and it can access global data. If you are
writing your first ISR, we recommend that you stick to the basics; just something that will convince you that it
works, such as incrementing a global variable.
NOTE:
If you are writing an ISR using assembly language, you are responsible for pushing and popping
registers and using IRET instead of RET.
There are a few cautions you must consider when writing your ISR. The most important is,
do not use any
DOS functions or routines that call DOS functions from within an ISR
. DOS is
not
reentrant; that is, a DOS
function cannot call itself. In typical programming, this will not happen because of the way DOS is written. But
what about when using interrupts Then, you could have a situation such as this in your program. If DOS function X
is being executed when an interrupt occurs and the interrupt routine makes a call to DOS function X, then function
X is essentially being called while it is already active. Such a reentrancy attempt spells disaster because DOS
functions are not written to support it. This is a complex concept and you do not need to understand it. Just make
sure that you do not call any DOS functions from within your ISR. The one wrinkle is that, unfortunately, it is not
obvious which library routines included with your compiler use DOS functions. A rule of thumb is that routines
which write to the screen, or check the status of or read the keyboard, and any disk I/O routines use DOS and should
be avoided in your ISR.
The same problem of reentrancy exists for many floating point emulators as well, meaning you may have to
avoid floating point (real) math in your ISR.
Note that the problem of reentrancy exists, no matter what programming language you are using. Even if you
are writing your ISR in assembly language, DOS and many floating point emulators are not reentrant. Of course,
there are ways around this problem, such as those which involve checking to see if any DOS functions are currently
active when your ISR is called, but such solutions are well beyond the scope of this discussion.
The second major concern when writing your ISR is to make it as short as possible in terms of execution time.
Spending long periods of time in your ISR may mean that other important interrupts are being ignored. Also, if you
相關(guān)PDF資料
PDF描述
DM6380L V.34 Integrated Data/ Fax/Voice/Speakerphone Modem Device Set
DM6381F V.34 Integrated Data/ Fax/Voice/Speakerphone Modem Device Set
DM6382F V.34 Integrated Data/ Fax/Voice/Speakerphone Modem Device Set
DM6383F V.34 Integrated Data/ Fax/Voice/Speakerphone Modem Device Set
DM336P V.34 Integrated Data/ Fax/Voice/Speakerphone Modem Device Set
相關(guān)代理商/技術(shù)參數(shù)
參數(shù)描述
DM6CD330J03 制造商:n/a 功能描述:DM6X033 S7B3A
DM6-M25 制造商:Mencom 功能描述:
DM6-MF-25 制造商:Mencom 功能描述:
DM6-MM-06 制造商:Mencom 功能描述:
DM6-MM-10 制造商:Mencom 功能描述: