DSPRelated.com
Forums

Interface assembler/C

Started by Bernhard 'Gustl' Bauer March 15, 2010
Hi,

is there a document that states the use of registers when calling a
assembler function from C. I know that B3 is the return address; B15 is
SP; A4, B4, A6, B6, ... are the arguments.

I checked the assembler code of a lib function. There was B10 saved to
the stack. I wonder what is located in B10, and if there are other
registers I must preserve.

TIA

Gustl

_____________________________________
Refer to the C compiler guide and C calling convention. Registers passed to the function are A4 (1st argunment), B4, A6, B6, A8, A10, B10.

It is the responsibility of the called function to save and restore A10-A15 and B10-B15 in case they get modified.

Return address is in B3, and return value is in A4.

Regards
JS

-----Original Message-----
From: c... [mailto:c...] On Behalf Of Bernhard 'Gustl' Bauer
Sent: Monday, March 15, 2010 9:17 AM
To: C6x
Subject: [c6x] Interface assembler/C

Hi,

is there a document that states the use of registers when calling a
assembler function from C. I know that B3 is the return address; B15 is
SP; A4, B4, A6, B6, ... are the arguments.

I checked the assembler code of a lib function. There was B10 saved to
the stack. I wonder what is located in B10, and if there are other
registers I must preserve.

TIA

Gustl

_____________________________________