Salma Salma - 17 days ago 6
C Question

Interrupt Vector Handler Address

I am developing a simple OS, which needs a small interrupt vectors. I have been reading about the interrupt vectors in order to understand the concepts.

Many of the resources refer to like this:
enter image description here

[1 ]http://www.embedded.com/electronics-blogs/programming-pointers/4025714/Modeling-interrupt-vectors#references

What confuses me is that how do I know the address of the interrupt handler? I know that I need to create different functions for the different types of interrupts but how can I know the address of the function?

I am developing my code in C.

Thanks

LPs LPs
Answer

Interrupt handler is, at the end, a function.

A function starts at "an address" and you can simply use its name to retrieve it.

The following code will warn about %p parameter type passed, but is explicative:

#include <stdio.h>

void dummy_ISR ( void )
{

}

int main ( void )
{
    printf("Address of function: %p\n", dummy_ISR);

}
Comments