Category : C Source Code
Archive   : C-ALL.ZIP
Filename : TI652.ASC

 
Output of file : TI652.ASC contained in archive : C-ALL.ZIP







PRODUCT : C++ NUMBER : 652
VERSION : All
OS : PC DOS
DATE : September 17, 1991 PAGE : 1/1

TITLE : Interrupt Handlers as Member Functions




An interrupt handler cannot be made a static member of a
class because there is no way to pass such a function a 'this'
pointer. It is possible, however, to overcome this difficulty by
creating a static member function that is given access to a
pointer to the class that is currently active. For example:

class ISR {
public:
static void interrupt handler();
ISR *active;
void handle();
};

void interrupt ISR::handler() {
active->handle();
}

In this example, ISR::handler() is installed as the handler and
active must be set to point to a valid instance of ISR.
































  3 Responses to “Category : C Source Code
Archive   : C-ALL.ZIP
Filename : TI652.ASC

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/