If I do something like:
extern "C" {
float * thePtr
}
in some .h file in the C program, then in a particular .asm file
.global _thePtr
now if in the C files somewhere there is a variable
float array[SOME_NUMBER];
and at some point we set thePtr = &array[0]
Can I in some fashion read each element of the array in the assembly file?
MOV32 SomeRegister, #_thePtr+0
MOV32 SomeRegiste4r, #_thePtr+2
etc?
The ultimate problem I am having is on the 28375D CLA you only have 2 address registers...
In a simple function that implements a simple filter, I would typically (say on the CPU which has 8 addressing registers) assign one to the input data, one to the output data, and one to the history data...
In this way I can write a loop that cycles through my elements, incrementing the address registers each time...
I looked and found one sample program where you show how say an IIR filter is implemented on the CLA, and you effectively 'unroll' the loop and manually access the data.
As such because you only have two address registers in the CLA I was thinking to still use the two address registers, say one for the history, and one for the output, but then I need to pass the input data in this global fashion so that I can 'unroll the loop' and directly index the incrementing sample. however to keep the structure of the progam consistent I was thinking to do something like:
extern "C" {
extern void theASMFunction ( float * ptr1, float * ptr2, float * ptr3);
float * thePtr;
}
myFunction(params ...) {
thePtr = myPTr3;
theASMFunction ( myPtr1, myPtr2, myPtr3);
}
now in the assembler code myPtr1 and myPtr2 will be loaded into MAR0, MAR1 on the CLA and myPtr3 on the stack... (not used, just maintained since on CPU would then load this into a 3rd addressing register) now by 'passing' this 3rd pointer the hope is in the asm file I can write my loop as:
_theASMFunction:
series of assembler instructions constituting 1 iteration of loop using MAR0 and MAR1 and @_thePtr+# idea.
series of assembler instructions consisting of 2nd iteration of loop
...
series of assembler instructions consisting of nth iteration of loop
Any suggestions as to how I can address the 3rd vector? (input is an array of N floats, output is an array of N floats, and history is an array of N floats
--Input-->+------------>+----> output
| ^
z^-1 |
| |
history --------+
Ideally I would just like a 3rd addressing register, but I don't want to play flip flop as it takes time to load and unload the addressing registers. Since we are optimizing for execution speed,
On the 28375D CPU its a simple:
MOV32 R0H, *XAR6++; load next input sample
MOV32 R1H, *XAR5; load next history sample for subtraction
RPTB end, numberOfElements
SUBF32 R2H, R0H, R1H Perform subtraction (ON CPU takes 2 cycles to become available to store)
|| MOV32 *XAR5++, R0H; Store the history
MOV32 R0H, *XAR6++; load next input sample
MOV32 *XAR4++, R2H;Store the Result
MOV32 R1H, *XAR5;Load Next history value for subtraction
end:
SUBF32 R2H, R0H, R1H
|| MOV32 *XAR5, R0H
NOP
MOV32 *XAR4, R2H
in this case XAR4 = result, XAR5 = history, XAR6 = new data
The question is how can I write this simple 4 line (SubF32 and 4 mov32s...) in CLA assembly? without the 3rd addressing register... it's starting to look very icky.

