[Menu]>[Guide to use the PIC]


Instruction spec (8) of PIC16 series


Instruction set

RRFRotate Right f through Carry
Form [label]RRFf, d
( label is omitable, shows SPACE code )
Operands f : Register file addesss ( 00(00h) to 127(7Fh) )
d : Destination select ( 0 or 1 )
Operation It moves the contents of the f register to the 1-bit right including the carry bit.
d = 0 : store result in W
d = 1 : store result in f
FlagIt sets the least significant bit of the f register to C.
Instruction
cycles
1 cycle


SLEEPGo into stanby mode
Form [label]SLEEP
( label is omitable, shows SPACE code )
OperandsNone
Operation It stops a clock generator and it makes a processor a standby mode.
It resets a watchdog timer.
When using the prescaler for the watchdog timer, it resets the prescaler, too.
FlagIt sets 1 to TO and it sets 0 to the PD.
Instruction
cycles
1 cycle





SUBLWSubtract W from literal
Form [label]SUBLWk
( label is omitable, shows SPACE code )
Operandsk : literal field ( 00(00h) to 255(FFh) )
Operation It executes the subtraction of the contents of the W register from the literal data.
In the actual calculation, it changes the content of the W register by the 2's complement and it adds with the literal data.
(EX)
Flag C=1, Z=0 ( Result is positive )
C=1, Z=1 ( Result is zero )
C=0, Z=0 ( Result is negative )
Instruction
cycles
1 cycle


SUBWFSubtract W from f
Form [label]SUBWFf, d
( label is omitable, shows SPACE code )
Operands f : Register file addesss ( 00(00h) to 127(7Fh) )
d : Destination select ( 0 or 1 )
Operation It executes the subtraction of the contents of the W register from the f register.
d = 0 : store result in W
d = 1 : store result in f
In the actual calculation, it changes the content of the W register by the 2's complement and it adds with the contents of the f register.
(EX)
Flag C=1, Z=0 ( Result is positive )
C=1, Z=1 ( Result is zero )
C=0, Z=0 ( Result is negative )
Instruction
cycles
1 cycle

Next instructions