OPTIONAL Lab D2: C Callable Assembly
Now we need to return the result. To return a value to the calling routine you will need to
place your 32-bit value in the ACC. What register is the result currently in? Adjust your
code, if necessary.
13. Save the assembly file as
sop-asm.asm
. (
Do not
name it
LabD2.asm
because the
compiler has already created with that name from the original
LabD2.c
code).
Defining the Function Prototype as External
14. Note in
LabD2.c
an “extern” modifier is placed in front of the sum-of-products function
prototype:
extern int sop(int*,int*,int); //sop function prototype
Verify Assembly Sum of Products Routine
15. Remove the
sop-c.c
file from the project and add the new
sop-asm.asm
assembly
file to the project.
16. Rebuild and verify that the new assembly sum-of-products routine produces the same
results as the C function.
End of Exercise
C28x – C Programming
D - 19
Summary of Contents for C28 Series
Page 64: ...Summary 3 16 C28x Peripheral Registers Header Files ...
Page 78: ...Interrupt Sources 4 14 C28x Reset and Interrupts ...
Page 218: ...Lab 9 DSP BIOS 9 22 C28x Using DSP BIOS ...
Page 244: ...Lab 10 Programming the Flash 10 26 C28x System Design ...
Page 273: ...Appendix A eZdsp F2812 C28x Appendix A eZdsp F2812 A 1 ...
Page 276: ...Appendix P2 Expansion Interface A 4 C28x Appendix A eZdsp F2812 ...
Page 277: ...Appendix P4 P8 P7 I O Interface C28x Appendix A eZdsp F2812 A 5 ...
Page 278: ...Appendix A 6 C28x Appendix A eZdsp F2812 ...
Page 279: ...Appendix P5 P9 Analog Interface C28x Appendix A eZdsp F2812 A 7 ...
Page 282: ...Appendix A 10 C28x Appendix A eZdsp F2812 TP1 TP2 Test Points ...