Specifications

mikroElektronika | Free Online Book | PIC Microcontrollers | Chapter 9: Instruction Set
TOC
Introduction
Ch. 1
Ch. 2
Ch. 3
Ch. 4
Ch. 5
Ch. 6
Ch. 7
Ch. 8
Ch. 9
App. A
App. B
App. C
Chapter 9: Instruction Set
It has been already mentioned that microcontrollers differs from other integrated circuits.
Most of them are ready for installation into the target device just as they are, this is not the
case with the microcontrollers. In order that the microcontroller may operate, it needs
precise instructions on what to do. In other words, a program that the microcontroller
should execute must be written and loaded into the microcontroller. This chapter covers the
commands which the microcontroller "understands". The instruction set for the 16FXX
includes 35 instructions in total. Such a small number of instructions is specific to the RISC
microcontroller because they are well-optimized from the aspect of operating speed,
simplicity in architecture and code compactness. The only disadvantage of RISC architecture
is that the programmer is expected to cope with these instructions.
Instruction Description Operation Flag CLK *
Data Transfer Instructions
MOVLW k Move constant to W k -> w 1
MOVWF f Move W to f W -> f 1
MOVF f,d Move f to d f -> d Z 1 1, 2
CLRW Clear W 0 -> W Z 1
CLRF f Clear f 0 -> f Z 1 2
SWAPF f,d Swap nibbles in f
f(7:4),(3:0) -> f(3:0),
(7:4)
1 1, 2
http://www.mikroe.com/en/books/picmcubook/ch9/ (1 of 35)5/3/2009 11:35:12 AM