assemblyembeddedmicrocontrollerstm8

What does '.dcall' mean in assembly code?


I'm trying to understand a program in assembly code which should be compiled with COSMIC compiler to run on STM8 controller.

At the beginning of the program, there are a couple of xref and xdef and then comes a .dcall statement or command. Here it is:

.dcall "2,0,__checksum16"

I searched the compiler's manual, the controller's programming manual and the internet in general but couldn't find what does this line mean.

Could someone please explain what does it mean and what are these comma-seperated entries mean?


Solution

  • It is an assembler directive marking the entry point, symbol name and stack usage of a function.

    According to this:

    [...] the first integer is the stack space used by the call instruction plus any automatic storage used by the function. The second integer is the number of bytes stacked by the caller.

    I suggest that given its name and function that it causes debug information to be inserted into the object file for use by the ZAP symbolic debugger. I am not familiar with the Cosmic tool chain, but it is also possibly used to perform stack depth analysis within the call graph by the linker.