Keil™, An ARM® Company

Discussion Forum

calling C-function from within assembler?

Next Thread | Thread List | Previous Thread Start a Thread | Settings

DetailsMessage
Read-Only
Author
Leonhard Fuchs
Posted
21-Nov-2000 13:44 GMT
Toolset
C166
New! calling C-function from within assembler?
I want to call a C-function from an assembler-file.

for example:
void asc0_SendInt(void) interrupt S0TINT using rbank_s0 
{
  ...my code
}

My Assemblerroutine looks like:
$MOD167				
$SEGMENTED

VEC_SEG  EQU 2         ;Segment
VEC_OFF  EQU 0000H     ;Offset
VECT_TAB SECTION CODE AT 4
VEC_PROC PROC
  JMPS VEC_SEG,VEC_OFF+004H
  JMPS VEC_SEG,VEC_OFF+008H
  JMPS VEC_SEG,VEC_OFF+00CH
  [..]
  JMPS VEC_SEG,VEC_OFF+0A8H  ;S0TINT
  [..]
  JMPS VEC_SEG,VEC_OFF+1F8H
  JMPS VEC_SEG,VEC_OFF+1FCH
VEC_PROC ENDP
VECT_TAB ENDS
END

I should replace
  JMPS VEC_SEG,VEC_OFF+0A8H  ;S0TINT

with something like
  asc0_SendInt

but I'm so far unable to fiddle out how to do this.

Any idea.
Thank you
Leo

Read-Only
Author
Doug Moore
Posted
24-Nov-2000 14:41 GMT
Toolset
C166
New! RE: calling C-function from within assembler?
Cheat. Turn on the option to generate a .src module and see how the compiler does it in the .src file. Then mimic that. The advanced programming section in the C166 compiler manual describes the resgister requirements for C and ASM parameter passing.
Read-Only
Author
Andrew Neil
Posted
24-Nov-2000 17:36 GMT
Toolset
C166
New! RE: calling C-function from within assembler?
... or use the CODE option to add the assembler listing to your normal compiler listfile.
Read-Only
Author
Keil Support
Posted
19-Dec-2000 14:27 GMT
Toolset
C166
New! RE: calling C-function from within assembler?
This is a test.

Next Thread | Thread List | Previous Thread Start a Thread | Settings