ISR in C++

Ivan Porres Paltor
Mon Aug 3 23:54:00 GMT 1998

Ivan Porres Paltor wrote:
> Hi!,
> I am using g++ for the Hitachi SH1 processor. ( sh-hms target ).
> The compiler works fine, but I am trying to do a interrupt service
> routine in C++.

Thanks to the people that helped me with the previous post.
Now, I realized that my g++ ignores the "#pragma interrupt" directive.

#pragma interrupt
extern "C"
void isrCPP {

The compiler accepts this code, but it does not save or restore the
registers and does not add a "Return-from-Interruption" op-code (rete in
the asm).

Is it a known bug? I am missing something?
Also, I am interested in a good OO mechanism to dispatch the interrupts.
If you know a good reference or you want to discuss about it please tell


Ivan Porres Paltor                    Turku Centre for Computer Science
Åbo Akademi, Department of Computer Science  Phone: +358-2-2154033   
Lemminkäinengatan 14A                             
FIN-20520 Turku - Finland          

More information about the crossgcc mailing list