Вы находитесь на странице: 1из 5

PIC instructions

1. addlw number
- (NOT FOR PIC16C5X SERIES) - adds a number with the number in the working
register.

2. addwf FileReg, f
- adds the number in the working register to the number in a file register (FileReg)
and puts the result in the file register.

3. addwf FileReg, w
- adds the number in the working register to the number in a file register (FileReg)
and puts the result back into the working register, leaving the file register
unchanged.

4. andlw number
- ANDs a number with the number in the working register, leaving the result in the
working reg.

5. andwf FileReg, f
- ANDs the number in the working register with the number in a file register (FileReg)
and puts the result in the file register

6. bcf FileReg, bit


- clears a bit in a file register (FileReg), i.e. makes the bit 0

7. bsf FileReg, bit


- sets a bit in a file register (FileReg), i.e. makes the bit 1
8. btfsc FileReg, bit
- tests a bit in a file register (FileReg) and skips the next instruction if the result
is clear (i.e. if that bit is 0).

9. btfss FileReg, bit


- tests a bit in a file register (FileReg) and skips the next instruction if the result is set
(i.e. if that bit is 1).

10. call AnySub


- makes the chip call a subroutine(AnySub), after which it will return to where it left
off.

11. clrf FileReg


- clears (makes 0) the number in a file register (FileReg).

12. clrw
- clears the working register.

13. clrwdt
- clears the watchdog timer.

14. comf FileReg, f


- complements (inverts - ones become zeroes, zeroes become ones) the number in
a file register (FileReg), leaving the result in the file register.

15. decf FileReg, f


- decrements (subtracts one from) a file register (FileReg) and puts the result in
the file register.

16. decfsz FileReg, f


- decrements a file register (FileReg) and if the result is zero it skips the next
instruction. The result is put in the file register.
17. goto Anywhere
- makes the chip go to somewhere in the program which YOU have labelled
'Anywhere'.

18. incf FileReg, f


- increments (adds one to) a file register (FileReg) and puts the result in the file
register.

19. incfsz FileReg, f


- increments a file register (FileReg) and if the result is zero it skips the next
instruction. The result is put in the file register.

20. iorlw number


- inclusive ORs a number with the number in the working register.

21. iorwf FileReg, f


- inclusive ORs the number in the working register with the number in a file register
(FileReg) and puts the result in the file register.

22. movfw FileReg or movf FileReg, w


- moves (copies) the number in a file register (FileReg) in the working register

23. movlw number


- moves (copies) a number into the working register.

24. movwf FileReg


- moves (copies) the number in the working register into a file register (FileReg).

25. nop
- this stands for : no operation, in other words - do nothing, (it seems useless, but it's
actually quite useful!)
26. option
- (NOT TO BE USED EXCEPT IN PIC16C5X SERIES) - takes the number in the
working register and moves it into the option register.

27. retfie
- (NOT FOR PIC16C5X SERIES) - returns from a subroutine and enables the
Global Interrupt Enable bit.

28. retlw number


- returns from a subroutine with a particular number (literal) in the working register.

29. return
- (NOT FOR PIC16C5X SERIES) - returns from a subroutine.

30. rlf FileReg, f


- rotates the bits in a file register (FileReg) to the left, putting the result in the file
register.

31. rrf FileReg, f


- rotates the bits in a file register (FileReg) to the right, putting the result in the file
register.

32. sleep
- sends the PIC to sleep, a lower power consumption mode.

33. sublw number


- (NOT FOR PIC16C5X SERIES) - subtracts the number in the working register from
a number.

34. subwf FileReg, f


- subtracts the number in the working register from the number in a file register
(FileReg) and puts the result in the file register.
35. swapf FileReg, f
- swaps the two halves of the 8 bit binary number in a file register (FileReg), leaving
the result in the file register.

36. tris PORTX


- (NOT TO BE USED EXCEPT IN PIC16C5X SERIES) - uses the number in the
working register to specify which bits of a port are inputs (correspond to a binary 1)
and which are outputs (correspond to 0).

37. xorlw number


- exclusive ORs a number with the number in the working register.

38. xorwf FileReg, f


- exclusive ORs the number in the working register with the number in a file register
(FileReg) and puts the result in the file register.

Вам также может понравиться