[A83] Re: im 2
[Prev][Next][Index][Thread]
[A83] Re: im 2
> Van: Gavin Olson <gtolson@snet.net>
>
> >I don't think so. Doing something in hardware can save you cpu time.
> >But using a timer interrupt and having routines randomly interrupt each
> >other will not make a program faster. Context switches like that incur
> >the penalty of having to save the state of the registers. If you really
> >want to get the most cycles per second, you need to disable the
> >interrupts and do everything yourself. You save the time it takes to
> >save/restore registers, or gain the use of shadow registers. Using
> >shadow registers can save you a lot of time.
>
> I think that what he means by 'random' is that interrupts are only
> activated if you need them, so if the screen doesn't need to get
> redrawn, don't do it. That saves a lot of time.
Okay, some explanation of the 'fuzyness':
1. He (Tijl C.) wants to program an interrupt-routine for general use,
think of it as a library you can add or link to your program.
-> So no "DI and do everyting yourself"
2. The interrupt will remain always on. Off coarse you can disable it, but
than you won't have the advances of the running interrupt.
-> So no activating / deactivating
3. (Fictive!) Let's say the interrupt will read from a special hardware
device mounted to your calc (probably via the linkport), it's kinda like a
graph-pad (what about touchscreen-LCD?), you can read several things from
it. It has for example a port to return the X,Y coords of the pen, and you
can check if one of the buttons mounted on it is pressed. Doing this right
after each other is needless, you can just read these out with different
interrupt-routines, since most of the 'events' will happen for longer than
160th of a second. So you don't need to install a 'heavy interrupt', you
can split it in halves.
(Hmm.. after all, I can't really find the reason why to use an interrupt in
this particular hardware-solution, but I hope you get the point)
-> Order of exection doesn't count
Can you now imagine what kind of interrupt-routine it could be? If not,
never mind, time will tell...
Henk Poley <><