Part Number: LAUNCHXL-F28379D
Other Parts Discussed in Thread: C2000WARE
Hello,
I want to manage a assembly gateway in a C project to calculate a difference equation. But I have many problems (my questions are yellowed). I hope that someone will be able to help me.
Let's consider this example: I want to multiply these two vector X'.Y


So, I created a function which is supposed to do that, using the insruction MACF32 R7H, R3H, *XAR4++, *XAR7++
![]()
Since the input values are respectively 2 pointers and an integer, there are transfered into XAR4, XAR5 and ACC.
Since the ouput value is a float, it will be stored into R0H.
First thing I have to do in the function is to transfer the XAR5 content into XAR7. I was looking for a function such MOV32 XARn,XARm, but it does not seem to exist.
So I wrote that:

It is not elegant, and there is a warning:

What is the best way to do this transfer ?
The rest of the code is :

The result is correct, but:
- I expected that the number of repeat would be 5, and not 7. Where is my mistake ?
- the number of repetition is not supposed to be a constant, but the last input value, i.e. uint16_myDim, stored in ACC. How can I transfer this value into the number of repetition ? I thought that RPT @ACC will work, but not.
Finally, I have a final question, a general one:
I tried to declare a variable into my asm function:

But when stopping the programm with a break point, this does not appear in the Expression window.

What is the way to declare a variable in a assembly gateway ?
Thank you for your help.
Down here the code of my assembly function:
; /!\ format EABI /!\
; fonction pouvant être appelée directement par asmfunc() dans un fichier C
.global asmfuncEQDIM
.data
Var .int 8
.text
asmfuncEQDIM:
NOP
NOP
MOV32 R1H,XAR5
NOP
MOV32 XAR7,R1H
ZERO R2H ; effacement du registre tampon pour le résultat de l'accumulation impaire
ZERO R6H ; effacement du registre tampon pour le résultat de l'accumulation paire
ZERO R3H ; effacement du registre d'accumulation impaire
ZERO R6H ; effacement du registre d'accumulation paire
; XAR7 doit contenir l'adresse du tableau Y (en XAR5)
RPT #7
|| MACF32 R7H, R3H, *XAR4++, *XAR7++
ADDF32 R0H, R7H, R3H ;
LRETR
