|
PIC12C67X Datasheet, PDF (76/129 Pages) Microchip Technology – 8-Pin, 8-Bit CMOS Microcontroller with A/D Converter and EEPROM Data Memory | |||
|
◁ |
PIC12C67X
GOTO
Syntax:
Operands:
Operation:
Status Affected:
Encoding:
Description:
Words:
Cycles:
Example
Unconditional Branch
[ label ] GOTO k
0 ⤠k ⤠2047
k â PC<10:0>
PCLATH<4:3> â PC<12:11>
None
10 1kkk kkkk kkkk
GOTO is an unconditional branch.
The eleven bit immediate value is
loaded into PC bits <10:0>. The
upper bits of PC are loaded from
PCLATH<4:3>. GOTO is a two
cycle instruction.
1
2
GOTO THERE
After Instruction
PC = Address THERE
INCF
Syntax:
Operands:
Operation:
Status Affected:
Encoding:
Description:
Words:
Cycles:
Example
Increment f
[ label ] INCF f,d
0 ⤠f ⤠127
d â [0,1]
(f) + 1 â (dest)
Z
00 1010 dfff ffff
The contents of register âfâ are
incremented. If âdâ is 0, the result
is placed in the W register. If âdâ is
1, the result is placed back in reg-
ister âfâ.
1
1
INCF CNT, 1
Before Instruction
CNT =
Z
=
After Instruction
CNT =
Z
=
0xFF
0
0x00
1
INCFSZ
Syntax:
Operands:
Operation:
Status Affected:
Encoding:
Description:
Words:
Cycles:
Example
Increment f, Skip if 0
[ label ] INCFSZ f,d
0 ⤠f ⤠127
d â [0,1]
(f) + 1 â (dest), skip if result = 0
None
00 1111 dfff ffff
The contents of register âfâ are
incremented. If âdâ is 0, the result
is placed in the W register. If âdâ is
1, the result is placed back in reg-
ister âfâ.
If the result is 0, the next instruc-
tion, which is already fetched, is
discarded. A NOP is executed
instead making it a two cycle
instruction.
1
1(2)
HERE
INCFSZ
GOTO
CONTINUE â¢
â¢
â¢
CNT, 1
LOOP
Before Instruction
PC = address HERE
After Instruction
CNT = CNT + 1
if CNT= 0,
PC = address CONTINUE
if CNTâ 0,
PC = address HERE +1
IORLW
Syntax:
Operands:
Operation:
Status Affected:
Encoding:
Description:
Words:
Cycles:
Example
Inclusive OR Literal with W
[ label ] IORLW k
0 ⤠k ⤠255
(W) .OR. k â (W)
Z
11 1000 kkkk kkkk
The contents of the W register are
ORâed with the eight bit literal 'k'.
The result is placed in the W reg-
ister.
1
1
IORLW 0x35
Before Instruction
W = 0x9A
After Instruction
W = 0xBF
Z=1
DS30561B-page 76
© 1999 Microchip Technology Inc.
|
▷ |