PIC18FXX20
GOTO
Unconditional Branch
INCF
Increment f
Syntax:
[ label ] GOTO k
0 ≤ k ≤ 1048575
k → PC<20:1>
None
Syntax:
Operands:
[ label ] INCF f [,d [,a]
Operands:
Operation:
Status Affected:
Encoding:
1st word (k<7:0>)
2nd word(k<19:8>)
0 ≤ f ≤ 255
d ∈ [0,1]
a ∈ [0,1]
(f) + 1 → dest
C, DC, N, OV, Z
Operation:
Status Affected:
Encoding:
1110
1111
1111
k kkk
kkkk
kkkk
7
0
8
k
kkk kkkk
0010
10da
ffff
ffff
19
Description:
GOTOallows an unconditional
Description:
The contents of register 'f' are
incremented. If 'd' is 0, the result is
placed in W. If 'd' is 1, the result is
placed back in register 'f' (default).
If ‘a’ is 0, the Access Bank will be
selected, overriding the BSR value.
If ‘a’ = 1, then the bank will be
selected as per the BSR value
(default).
branch anywhere within entire
2-Mbyte memory range. The 20-bit
value ‘k’ is loaded into PC<20:1>.
GOTOis always a two-cycle
instruction.
2
2
Words:
Cycles:
Q Cycle Activity:
Q1
Words:
Cycles:
1
1
Q2
Q3
Q4
Decode
Read literal
No
Read literal
Q Cycle Activity:
Q1
'k'<7:0>,
operation
’k’<19:8>,
Write to PC
No
operation
Q2
Q3
Q4
No
operation
No
operation
No
operation
Decode
Read
register 'f'
Process
Write to
Data
destination
GOTO THERE
Example:
INCF
CNT, 1, 0
Example:
After Instruction
Before Instruction
PC
=
Address (THERE)
CNT
Z
=
0xFF
=
=
=
0
?
?
C
DC
After Instruction
CNT
Z
=
=
=
=
0x00
1
1
1
C
DC
DS39609A-page 280
Advance Information
2003 Microchip Technology Inc.