|
PIC18FXX8 Datasheet, PDF (304/402 Pages) Microchip Technology – 28/40-Pin High-Performance, Enhanced Flash Microcontrollers with CAN Module | |||
|
◁ |
PIC18FXX8
GOTO
Unconditional Branch
Syntax:
[ label ] GOTO k
Operands:
0 ⤠k ⤠1048575
Operation:
k â PC<20:1>
Status Affected: None
Encoding:
1st word (k<7:0>)
2nd word(k<19:8>)
Description:
1110 1111 k7kkk kkkk0
1111 k19kkk kkkk kkkk8
GOTO allows an unconditional branch
anywhere within entire 2-Mbyte memory
range. The 20-bit value âkâ is loaded into
PC<20:1>. GOTO is always a two-cycle
instruction.
Words:
2
Cycles:
2
Q Cycle Activity:
Q1
Decode
Q2
Read literal
âkâ<7:0>
No
operation
No
operation
Q3
No
operation
No
operation
Q4
Read literal
âkâ<19:8>,
Write to PC
No
operation
Example:
GOTO THERE
After Instruction
PC = Address (THERE)
INCF
Syntax:
Operands:
Operation:
Status Affected:
Encoding:
Description:
Words:
Cycles:
Q Cycle Activity:
Q1
Decode
Increment f
[ label ] INCF f [,d [,a]]
0 ⤠f ⤠255
d â [0,1]
a â [0,1]
(f) + 1 â dest
C, DC, N, OV, Z
0010 10da ffff ffff
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).
1
1
Q2
Read
register âfâ
Q3
Process
Data
Q4
Write to
destination
Example:
INCF
Before Instruction
CNT =
Z
=
C
=
DC
=
After Instruction
CNT =
Z
=
C
=
DC
=
0xFF
0
?
?
0x00
1
1
1
CNT,
DS41159D-page 302
 2004 Microchip Technology Inc.
|
▷ |