G'day,

When calling a routine that accepts a variable argument list (specifically
snprintf()) the compiler seems to be generating code that would not work.
The problem is the compiler is passing the function parameters as registers,
whereas any routine which accepts variable arguments is looking for
arguments from the stack.

The dissassembled output from a sample call to snprintf() is:

  snprintf( ucOutBuff, sizeof(ucOutBuff), "Off: 0x%x", usTimeOff );
11de:   1c 42 02 02   mov           &0x0202,r12   ;0x0202
11e2:   3d 40 85 11   mov           #4485,  r13   ;#0x1185
11e6:   3e 40 11 00   mov           #17,    r14   ;#0x0011
11ea:   3f 40 3e 02   mov           #574,   r15   ;#0x023e
11ee:   b0 12 8e 23   call    #9102           ;#0x238e
 
Am using the 2004-11-12 version of mspgcc-win32.  The CFLAGS in the makefile
is:
CFLAGS  = -mmcu=$(MCU) -c -g -Os

Am open to any ideas on what to do here.  
 
aLUNZ



Reply via email to