14.7.2 Return Value
Function return values are returned in registers whenever possible. For dsPIC33A, floating point type variables are returned in F registers, otherwise all return values are in W registers. The following chart should help decipher where to place, or look for, return values.
Return kind | Architecture | Location |
---|---|---|
8-bit integer | All | W0 |
16-bit integer | All | W0 |
32-bit integer | dsPIC33C/E/F and dsPIC30F | W1:W0 |
dsPIC33A | W0 | |
64-bit integer | dsPIC33C/E/F and dsPIC30F | W3:W2:W1:W0 |
dsPIC33A | W1:W0 | |
32-bit float | dsPIC33C/E/F and dsPIC30F | W1:W0 |
dsPIC33A | F0 | |
64-bit float | dsPIC33C/E/F and dsPIC30F | W3:W2:W1:W0 |
dsPIC33A | F1:F0 | |
struct | All | Indirectly through storage pointed to in W0 |