Sunteți pe pagina 1din 1

1.

1 Descripción General 11

Instrucciones de carga
Sintaxis Descripción Ciclos Código de 14 bits Banderas
CLRF f (f) = b’00000000’ 1 00 0001 1fff ffff Z
CLRW (W)= b’00000000’ 1 00 0001 1xxx xxxx Z
MOVF f,d (f)= (f) si d=1, (W)= (f) si d=0 1 00 1000 dfff ffff Z
MOVWF f (f)= (W) 1 00 0000 1fff ffff Z
MOVLW k (W)= k 1 00 00xx kkkk kkkk Z

Instrucciones aritméticas
Sintaxis Descripción Ciclos Código de 14 bits Banderas
ADDLW k (W)= (W)+k 1 11 111x kkkk kkkk C,DC,Z
ADDWF f,d (f)= (f)+(W) si d=1, (W)= (f)+(W) si d=0 1 00 0111 dfff ffff C,DC,Z
DECF f,d (f)= (f) -1 si d=1, (W)= (f) -1 si d=0 1 00 0011 dfff ffff Z
INCF f,d (f)= (f)+1 si d=1, (W)= (f)+1 si d=0 1 00 1010 dfff ffff Z
SUBLW k (W)= k -(W) 1 11 110x kkkk kkkk C,DC,Z
SUBWF f,d (f)= (f)-(W) si d=1, (W)= (f)-(W) si d=0 1 00 0010 dfff ffff C,DC,Z

Instrucciones de bits
Sintaxis Descripción Ciclos Código de 14 bits Banderas
BCF f,b (f)[b]=0, Pone bit b de (f) a 0 (0<=b<=7) 1 01 01bb bfff ffff —
BSF f,b (f)[b]=0, Pone bit b de (f) a 1 (0<=b<=7) 1 01 01bb bfff ffff —

Instrucciones de salto
Sintaxis Descripción Ciclos Código de 14 bits Banderas
BTFSC f,b Si bit (f)[b] es 0 → salta siguiente instrucción 1(2) 01 10bb bfff ffff —
BTFSS f,b Si bit (f)[b] es 1 → salta siguiente instrucción 1(2) 01 11bb bfff ffff —
DECFSZ f,d Si d=1 → (f) = (f) -1 y salta sig. instr. si (f)=0, 1(2) 00 1011 dfff ffff —
si d=0 → (W)= (f) -1 y salta sig. instr. si (W)=0
INCFSZ f,d Si d=1 → (f) = (f)+1 y salta sig. instr. si (f)=0, 1(2) 00 1111 dfff ffff —
si d=0 → (W)= (f)+1 y salta sig. instr. si (W)=0
GOTO k (PC)= k, Salto incondicional 2 10 1kkk kkkk kkkk —

Instrucciones lógicas básicas


Sintaxis Descripción Ciclos Código de 14 bits Banderas
ANDLW k (W)= (W) AND k 1 11 111x kkkk kkkk Z
ANDWF f,d (f)= (f) AND (W) si d=1, (W)= (f) AND (W) si d=0 1 00 0111 dfff ffff Z
IORLW k (W)= (W) OR k 1 11 1000 kkkk kkkk Z
IORWF f,d (f) = (f) OR (W) si d=1, (W)= (f) OR (W) si d=0 1 00 0100 dfff ffff Z
XORLW k (W)= (W) XOR k 1 11 1010 kkkk kkkk Z
XORWF f,d (f)= (f) XOR (W) si d=1, (W)= (f) XOR (W) si d=0 1 00 0110 dfff ffff Z

Instrucciones lógicas especiales


Sintaxis Descripción Ciclos Código de 14 bits Banderas
COMF f,d (f)= (f ) si d=1, (W)= (f ) si d=0 1 00 1001 dfff ffff Z
RLF f,d Rota (f) a la izquierda a través del acarreo. 1 01 1101 dfff ffff C
Si d=1 resultado a (f), si d=0 resultado a (W)
RRF f,d Rota (f) a la derecha a través del acarreo. 1 01 1100 dfff ffff C
Si d=1 resultado a (f), si d=0 resultado a (W)
SWAPF f,d Intercambia nibble de (f). Si d=1 resultado a (f), 1 00 1110 dfff ffff —
si d=0 resultado a (W)

Instrucciones para subrutinas


Sintaxis Descripción Ciclos Código de 14 bits Banderas
CALL k Llamada a subrutina. (Pila) ← (PC), (PC)= k 2 10 0kkk kkkk kkkk —
RETFIE (PC) ← (Pila). Retorno de interrupción 2 00 0000 0000 1001 —
RETLW k (PC) ← (Pila) y (W)=k. Retorno de subrutina 2 11 01xx kkkk kkkk —
RETURN (PC) ← (Pila). Retorno de subrutina 2 00 0100 0000 1000 —

Instrucciones especiales
Sintaxis Descripción Ciclos Código de 14 bits Banderas
CLRWDT Borra o refresca el Perro Guardián 1 00 0000 0110 0100 T O, P D
NOP No Opera. Deja pasar un ciclo de instrucción 1 00 0000 0xx0 0000 —
SLEEP Pasa al modo reposo (bajo consumo) 1 00 0000 0110 0011 T O, P D

S-ar putea să vă placă și