This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS 3.1.0 Calling with Long Arguments on '5410A

Hello:

  I am having difficulty when a function is called with two long arguments. The first argument is passed in ACCA. The second, however, is coded (by CCS) using the DST (double store) command, but is placed on the stack in the wrong position (*SP(0) instead of *SP(1)). Is there a fix or work-around for this problem?

  Thank you.

Mark Peterson

  • As I read the calling convention, *SP(0) is the correct position; *SP(1) isn't double-word aligned. This test case works without any trouble:

    /* file1.c */
    void func(unsigned long, unsigned long); 
    int main(void) { func(0x12345678, 0xaabbccdd); return 0; } 
    /* file2.c */
    #include <stdio.h>
    void func(unsigned long x, unsigned long y) { printf("%lx %lx\n", x, y); }
    

    Do you have a test case which demonstrates the problem?