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 kindArchitectureLocation
8-bit integerAllW0
16-bit integerAllW0
32-bit integerdsPIC33C/E/F and dsPIC30FW1:W0
dsPIC33AW0
64-bit integerdsPIC33C/E/F and dsPIC30FW3:W2:W1:W0
dsPIC33AW1:W0
32-bit floatdsPIC33C/E/F and dsPIC30FW1:W0
dsPIC33AF0
64-bit floatdsPIC33C/E/F and dsPIC30FW3:W2:W1:W0
dsPIC33AF1:F0
structAllIndirectly through storage pointed to in W0