microcontroller - how are function addresses cast or assigned for interrupt vectors in C? -
let's have micro controller , know when receives interrupt jump address 0x8000 (just example). how define in c, seems might similar casting address variable can read or write memory.
usually support package comes pragma statement or other way indicate interrupt code is. want understand how in standard c. kind of function pointers or something?
not straight c answer here, here's how i've seen done on systems i've worked with:
the best way place function @ address use linker script of sort. lets control how code align , run. not sure flavor of c using, i've used had ability set locations via linker.
next up, define pointer @ location "jump" instruction wherever want interrupt code live. best done assembler , .org statement though. how did on old hardware allowed change vector did changing actual jump op-code point elsewhere.
Comments
Post a Comment