0% found this document useful (0 votes)
36 views

Instruction Description Operation Flag CLK Data Transfer Instructions

The document describes various instruction types for a microcontroller including: - Data transfer instructions to move data between registers and memory - Arithmetic instructions to perform math operations on data - Logic instructions for AND, OR, and XOR operations - Bit manipulation instructions to set, clear, and test individual bits - Program flow instructions for branching, subroutines, and interrupts - Other instructions for tasks like clearing the watchdog timer and entering sleep mode.

Uploaded by

guntadi
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views

Instruction Description Operation Flag CLK Data Transfer Instructions

The document describes various instruction types for a microcontroller including: - Data transfer instructions to move data between registers and memory - Arithmetic instructions to perform math operations on data - Logic instructions for AND, OR, and XOR operations - Bit manipulation instructions to set, clear, and test individual bits - Program flow instructions for branching, subroutines, and interrupts - Other instructions for tasks like clearing the watchdog timer and entering sleep mode.

Uploaded by

guntadi
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 1

Instruction Description Data Transfer Instructions MOVLW k Move constant to W MOVWF f Move W to f MOVF f,d Move f to d CLRW Clear

W CLRF f Clear f SWAPF f,d Swap nibbles in f Arithmetic-logic Instructions ADDLW k Add W and constant ADDWF f,d Add W and f SUBLW k Subtract W from constant SUBWF f,d Subtract W from f ANDLW k Logical AND with W with constant ANDWF f,d Logical AND with W with f ANDWF f,d Logical AND with W with f IORLW k Logical OR with W with constant IORWF f,d Logical OR with W with f XORLW k Logical exclusive OR with W with constant XORWF f,d Logical exclusive OR with W with f INCF f,d Increment f by 1 DECF f,d Decrement f by 1 RLF f,d Rotate left f through CARRY bit RRF f,d Rotate right f through CARRY bit COMF f,d Complement f Bit-oriented Instructions BCF f,b Clear bit b in f BSF f,b Set bit b in f Program Control Instructions BTFSC f,b Test bit b of f. Skip the following instruction if clear. BTFSS f,b Test bit b of f. Skip the following instruction if set. DECFSZ f,d Decrement f. Skip the following instruction if clear. INCFSZ f,d Increment f. Skip the following instruction if set. GOTO k Go to address CALL k Call subroutine RETURN Return from subroutine RETLW k Return with constant in W RETFIE Return from interrupt Other instructions NOP No operation CLRWDT Clear watchdog timer SLEEP Go into sleep mode

Operation k -> w W -> f f -> d 0 -> W 0 -> f f(7:4),(3:0) -> f(3:0),(7:4) W+k -> W W+f -> d k-W -> W f-W -> d W AND k -> W W AND f -> d W AND f -> d W OR k -> W W OR f -> d W XOR k -> W W XOR f -> d f+1 -> f f-1 -> f

Flag 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

CLK

Z Z Z

1, 2 2 1, 2

f -> d 0 -> f(b) 1 -> f(b) Skip if f(b) = 0 Skip if f(b) = 1 f-1 -> d skip if Z = 1 f+1 -> d skip if Z = 0 k -> PC PC -> TOS, k -> PC TOS -> PC k -> W, TOS -> PC TOS -> PC, 1 -> GIE TOS -> PC, 1 -> GIE 0 -> WDT, 1 -> TO, 1 -> PD 0 -> WDT, 1 -> TO, 0 -> PD

C, DC, Z C, DC ,Z C, DC, Z C, DC, Z Z Z Z Z Z Z Z Z Z C C Z

1, 2 1, 2 1, 2 1, 2 1, 2 1, 2 1, 2 1, 2 1, 2 1, 2 1, 2 1,2 1,2 3 3 1, 2, 3 1, 2, 3

1 (2) 1 (2) 1 (2) 1 (2) 2 2 2 2 2 1 1 1

TO, PD TO, PD

You might also like