You can do it in C...
The compiler will do nothing automatically (because of the naked
property), so you can do whatever you want w/ the registers in __asm__
statements.  And the vector table is set.
Check section "6. Interrupt API" here:
http://mspgcc.sourceforge.net/doc_intro.html
Here's a quick example asm statement that will add two numbers together
(in BCD math):
In this case, there are two globals:

unsigned long int var1, inc1;

__attribute__((naked)) interrupt (BASICTIMER_VECTOR) wakeup
BasicTimerIRQ(void)
{
    __asm__( "CLRC                       \n\t"
             "DADD.W  %A1, %A0           \n\t"
             "DADD.W  %B1, %B0           \n\t"
             : "=m" (var1)
             : "m" (inc1) );
    __asm__( "reti" );
}

-Mark


-----Original Message-----
From: mspgcc-users-ad...@lists.sourceforge.net
[mailto:mspgcc-users-ad...@lists.sourceforge.net] 
Sent: Monday, February 24, 2003 3:44 PM
To: mspgcc-users@lists.sourceforge.net
Subject: [Mspgcc-users] assembler interrupts


How can I specify that an assembler function is a particular interrupt
handler. In other words, how to I set the vector table entry in
assembler. I would like to make a timer A interrupt handler in assembly.
I have done it in C, but need more control over the exact register
usage.


Reply via email to