1 # `abi_msp430_interrupt`
3 The tracking issue for this feature is: [#38487]
5 [#38487]: https://github.com/rust-lang/rust/issues/38487
7 ------------------------
9 In the MSP430 architecture, interrupt handlers have a special calling
10 convention. You can use the `"msp430-interrupt"` ABI to make the compiler apply
11 the right calling convention to the interrupt handlers you define.
13 <!-- NOTE(ignore) this example is specific to the msp430 target -->
16 #![feature(abi_msp430_interrupt)]
19 // Place the interrupt handler at the appropriate memory address
20 // (Alternatively, you can use `#[used]` and remove `pub` and `#[no_mangle]`)
21 #[link_section = "__interrupt_vector_10"]
23 pub static TIM0_VECTOR: extern "msp430-interrupt" fn() = tim0;
25 // The interrupt handler
26 extern "msp430-interrupt" fn tim0() {
32 $ msp430-elf-objdump -CD ./target/msp430/release/app
33 Disassembly of section __interrupt_vector_10:
35 0000fff2 <TIM0_VECTOR>:
36 fff2: 00 c0 interrupt service routine at 0xc000
38 Disassembly of section .text: