How to start "C" functions from HCS12 assembler ??

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How to start "C" functions from HCS12 assembler ??

4,367件の閲覧回数
Gizzzmo
Contributor I
Hello,

I would make a "secondary interrupt vector table" on a HCS12E128 in order to modify my "interrupt vectors" on the fly (they are in a protected part of the flash). I've made this "secondary interrupt vector table" with a assembler file and i wanna start "C" functions from this file but i dont find how (with a CALL or a JSR for example).

Gizmo.

P.S:smileyfrustrated:orry for my approximative english, i'm french
ラベル(1)
0 件の賞賛
4 返答(返信)

672件の閲覧回数
Sten
Contributor IV

If your C functions are ordinary ISR routines (like interrupt void TimerISR(void) ) then you should call them with a plain JMP TimerISR. ISR C-routines are ended with a RTI instruction, and they must be called directly from the interrupt (and they must be in the non-paged area of the memory).

An other way to do it would be that your assembler routine calls ordinary C functions (like void TimerSecISR(void)) with a CALL TimerSecISR (if TimerSecISR is in paged memory) or JSR TimerSecISR (non-paged memory), but then your assembler routine must be aware of that the control will return to it after the routine completes and the RTI must be in the assembler code.

 

0 件の賞賛

672件の閲覧回数
Gizzzmo
Contributor I
I've tried this but the assembler file doesn't find my C-routine.

How can I make him find my routine ?

Thx
0 件の賞賛

672件の閲覧回数
Sten
Contributor IV
You have to use the XREF directive to tell the assembler that the routines are external. The linker will then take care of inserting the correct addresses into the generated code.
 
0 件の賞賛

672件の閲覧回数
Gizzzmo
Contributor I
Thx a lot, it works really well :smileywink:
0 件の賞賛