28.2.124 __builtin_sftac

Architecture

dsPIC33A, dsPIC33C/E/F, dsPIC30

Description

Shifts accumulator by shift. The valid shift range is -16 to 16.

For example:

 volatile register int16_t result asm(“A”);
 int16_t i;

 result = __builtin_sftac(result,i);

Might generate:

 sftac A, w0

Prototype

int __builtin_sftac(int Accum, int shift);

For dsPIC33A, int is int32_t. For dsPIC33C/E/F and dsPIC30, int is int16_t.

Arguments

Accum – Accumulator to shift.

shift – Amount to shift.

Return Value

Returns the shifted result to an accumulator.

Machine Instruction

sftac

Error Messages

An error message will be displayed if:
  • the result is not an accumulator register
  • Accum is not an accumulator register
  • the shift value is not a literal within range