In: Electrical Engineering
a) Goto - It stands for "Go to address". This command sends the program flow directly to the other mentioned program line or label.
For ex:- The most simple example
ORG 0x00h; position 0 in the program memory.
BCF PCLATH, 4 ;
BSF PCLATH, 3 ;These two instructions will select page 1.
GOTO Label_1; This command sends program to Label_1 i.e. another
page than original position of this instruction
.
.
.
ORG 0xA00h; position 0xA00 in the program memory.
Label_1
.
.
In the above case when the program reaches at GOTO command, it will
not execute commands after GOTO but will jump directly to the
Label_1 line of the program and will continue from there.
b) RRF - It stands for "Rotate right f through carry bit". Register ' f ' contents are rotated through the Carry Flag one bit to the right.
Ex:- (Syntax - RRF f,d)
(The result will be put in the W register if 'd ' is 0. If 'd ' is 1 the value is returned to the ' f ' register.)
RRF REG1 , 0
Before Instruction
REG1= 1110 0110
W = xxxx xxxx
C = 0
After Instruction
REG1= 1110 0110
W = 0111 0011
C = 0
c) SWAPF - It stands for " Swap nibbles in f ". Nibbles (upper and lower) of register ' f ' are exchanged.
Ex:- (Syntax - SWAPF f , d )
The result will be put in W register if 'd ' is 0. If 'd ' is 1 the result is set in the ' f ' register.
SWAPF REG, 0
Before Instruction
REG1= 0xA5
After Instruction
REG1= 0xA5
W = 0x5A
d) XORLW - It stands for "Exclusive OR Literal with W". The W register's contents are XOR'ed with the 8 bit literal ' k. ' The output will be stored in the W register.
Ex:- (Syntax - XORLW k )
XORLW 0xAF ; 1010 1111 (0xAF)
Before Instruction ;
W = 0xB5 ;
1011 0101 (0xB5)
After Instruction ;
--------------------------------
W = 0x1A ; 0001
1010 (0x1A)
Z = 0;
NOTE - Register Z is the register with affected status due to this command.