Micro

Páginas: 8 (1836 palabras) Publicado: 13 de mayo de 2011
Instrucciones del PIC16F84A

http://perso.wanadoo.es/pictob/instrucciones.htm#instrucciones_especiales

DISPOSITIVOS LÓGICOS MICROPROGRAMABLES Índice / Introducción El lenguaje ensamblador del PIC16F84A

Instrucciones del PIC16F84A Técnicas de programación

9.1

Instrucciones del PIC16F84A
Índice de contenidos
Instrucciones del PIC16F84A Índice de contenidos Introducción Repertorio 35instrucciones Instrucciones OPTION y TRIS Instrucciones especiales

1 de 50

09/03/2011 11:41 a.m.

Instrucciones del PIC16F84A

http://perso.wanadoo.es/pictob/instrucciones.htm#instrucciones_especiales

DISPOSITIVOS LÓGICOS MICROPROGRAMABLES

Instrucciones del PIC16F84A

9.2

Introducción
El PIC16F84A pertenece a la gama media y es de tipo RISC; esto quiere decir que tiene unjuego de instrucciones reducido, en concreto de 35 instrucciones o nemónicos que son la base de funcionamiento del PIC. Al igual que los bits de los registros, sería complicado memorizarlas todas, así que utilizaremos este documento como guía de consulta. Las instrucciones fundamentalmente se dividen en tres tipos. Esta división viene dada por el tipo de datos con los que trabajan: Instruccionesorientadas a los registros o bytes (byte-oriented operations). Instrucciones orientadas a los bits (bit-oriented operations). Operaciones con literales y de control (literal and control operations).

2 de 50

09/03/2011 11:41 a.m.

Instrucciones del PIC16F84A

http://perso.wanadoo.es/pictob/instrucciones.htm#instrucciones_especiales

DISPOSITIVOS LÓGICOS MICROPROGRAMABLES

Instruccionesdel PIC16F84A

9.3

Repertorio 35 instrucciones
Las 35 instrucciones ó mnemónicos de la gama media de Microchip las encontraremos resumidas en la siguiente tabla. w es el acumulador, f representa un registro cualquiera y C, DC, Z los flags del registro STATUS. Instrucciones orientadas a registros MNEMÓNICO OPERANDOS ADDWF ANDWF CLRF CLRW COMF DECF DECFSZ INCF INCFSZ IORWF MOVF MOVWF NOP RLFRRF SUBWF SWAPF XORWF f,d f,d f f,d f,d f,d f,d f,d f,d f,d f f,d f,d f,d f,d f,d DESCRIPCIÓN w+f→d w AND f → d 00 h → f 00 h → w Complemento de f → d f-1→d f - 1 → d (si es 0 salta) f+1→d f + 1 → d (si es 0 salta) w OR f → d f→d w→f No operación Rota f izq por carry → d Rota f dcha por carry → d f-w→d CÓDIGO OP
00 0111 dfff ffff 00 0101 dfff ffff 00 0001 1fff ffff 00 0001 0xxx xxxx 00 1001 dfffffff 00 0011 dfff ffff 00 1011 dfff ffff 00 1010 dfff ffff 00 1111 dfff ffff 00 0100 dfff ffff 00 1000 dfff ffff 00 0000 1fff ffff 00 0000 0xx0 0000 00 1101 dfff ffff 00 1100 dfff ffff 00 0010 dfff ffff

BANDERAS NCIC NOTAS C, DC, Z Z Z Z Z Z Ninguna Z Ninguna Z Z Ninguna Ninguna C C C,DC,Z 1 1 1 1 1 1 1(2) 1 1(2) 1 1 1 1 1 1 1 1 1 1,2 1,2 2 1,2 1,2 1,2,3 1,2 1,2,3 1,2 1,2 1,2 1,2 1,2 1,2 1,2Intercambia nibbles de f → d 00 1110 dfff ffff Ninguna w XOR f → d
00 0110 dfff ffff

Z

Instrucciones orientadas a bit MNEMÓNICO OPERANDOS BCF BSF f,b f,b DESCRIPCIÓN Pone a 0 bit b de registro f Pone a 1 bit b de registro f CÓDIGO OP BANDERAS NCIC NOTAS
01 00bb bfff ffff 01 01bb bfff ffff

Ninguna Ninguna

1 1

1,2 1,2

3 de 50

09/03/2011 11:41 a.m.

Instrucciones delPIC16F84A

http://perso.wanadoo.es/pictob/instrucciones.htm#instrucciones_especiales

BTFSC BTFSS

f,b f,b

Salto si bit b de reg. f 01 10bb bfff ffff es 0 Salto si bit b de reg. f 01 11bb bfff ffff es 1

Ninguna Ninguna

1(2) 1(2)

3 3

4 de 50

09/03/2011 11:41 a.m.

Instrucciones del PIC16F84A

http://perso.wanadoo.es/pictob/instrucciones.htm#instrucciones_especialesDISPOSITIVOS LÓGICOS MICROPROGRAMABLES

Instrucciones del PIC16F84A

9.4

Instrucciones con literales y de control MNEMÓNICO OPERANDOS ADDLW ANDLW CALL CLRWDT GOTO IORLW MOVLW RETFIE RETLW RETURN SLEEP SUBLW XORLW Notas: 1. Al modificar un registro de E/S con una operación sobre él mismo (por ejemplo MOVF PORTB,1), el valor utilizado es el que se halle presente en las patillas del PORTB. Por...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Micro
  • Micro
  • Micro
  • Micro
  • Micro
  • micro
  • micro
  • Micro

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS