Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
11/16/98 04:53
Read: times


 
#53 - RE: 80c320 interrupts problem
The only way that I know of around your problem is to work with "pseudo-interrupts."

For example, you assign a user bit to each interrupt. For example, for External 0 it could be bit 00h and for Timer 0 it could be bit 01h. When your interrupt executes you just set the appropriate bit and exit. Then somewhere else in your program you check the bits and execute the interrupt code "manually". For example:

ORG 0000h
LJMP MAIN

ORG 0003h
SETB 00h
RETI

ORG 001Bh
SETB 01h
RETI

ORG 0100h
MAIN:
MOV IE,#0FFh

MAIN_LOOP:
JBC 00h,INT_EX0
JBC 01h,INT_TM0
(whatever your program needs to do)
LJMP MAIN_LOOP

INT_EX0:
{Your ex0 interrupt code goes here)
RET

INT_TM0:
(your tm0 interrupt code goes here)
RET

In this way, your interrupt only lasts two instructions: setting a temporary bit and RETI. Then when your program cycles back to MAIN_LOOP your interrupt code is executed--but it is no longer within the interrupt; thus if another interrupt occurs, it will be triggered as soon as your currently executing routine is finished.

Your interrupts will be serviced in the order you put them in the MAIN_LOOP section of code.

It's definitely a "work-around" but it should work.

Hope this helps,
Craig Steiner


List of 2 messages in thread
TopicAuthorDate
80c320 interrupts problem            01/01/70 00:00      
RE: 80c320 interrupts problem            01/01/70 00:00      

Back to Subject List