Conventions
Mardi, 29 Décembre 2009 21:20
jlf
Conventions
f : représente un numéro de registre codé sur 7 bits
b : représente un numéro de bit, codé sur 3 bits
k : représente une donnée : le “Literal” dont le format (8 bits en général) dépend de l’instruction
d : est utilisé pour les opérations entre le registre W et un registre f
- si d=0 le résultat est placé dans W
- si d=1 le résultat est placé dans f
 x : valeur quelconque
Instructions sur les registres en octets
Mardi, 29 Décembre 2009 21:26
jlf
Instructions sur les registres en octets

Mnémonique
|
Opérandes
|
Description
|
Bits d'état
|
Opcode Binaire
|
Opcode Hex
|
Cycles
|
Notes
|
ADDWF |
f,d |
Add W and f |
C,DC,Z |
00 0111 dfff ffff |
07ff |
1
|
1,2 |
ANDWF |
f,d |
And W with f |
Z |
00 0101 dfff ffff |
05ff |
1
|
1,2 |
CLRF |
f |
Clear f |
Z |
00 0001 1fff ffff |
01ff |
1
|
2 |
CLRW |
|
Clear W |
Z |
00 0001 0xxx xxxx |
0100 |
1
|
|
COMF |
f,d |
Complement f |
Z |
00 1001 dfff ffff |
09ff |
1
|
1,2 |
DECF |
f,d |
Decrement f |
Z |
00 0011 dfff ffff |
03ff |
1
|
1,2 |
DECFSZ |
f,d |
Decrement f, Skip if 0 |
|
00 1011 dfff ffff |
0Bff |
1(2)
|
1,2,3 |
INCF |
f,d |
Increment f |
Z |
00 1010 dfff ffff |
0Aff |
1
|
1,2 |
INCFSZ |
f,d |
Increment f, Skip if 0 |
|
00 1111 dfff ffff |
0Fff |
1(2)
|
1,2,3 |
IORWF |
f,d |
Inclusive OR W with f |
Z |
00 0100 dfff ffff |
04ff |
1
|
1,2 |
MOVF |
f,d |
Move f |
Z |
00 1000 dfff ffff |
08ff |
1
|
1,2 |
MOVWF |
f |
Move W to f |
|
00 0000 1fff ffff |
00ff |
1
|
|
NOP |
|
No Operation |
|
00 0000 0xx0 0000 |
0000 |
1
|
|
RLF |
f,d |
Rotate Left through Carry |
C |
00 1101 dfff ffff |
0Dff |
1
|
1,2 |
RRF |
f,d |
Rotate Right f through Carry |
C |
00 1100 dfff ffff |
0Cff |
1
|
1,2 |
SUBWF |
f,d |
Subtract W from f |
C,DC,Z |
00 0010 dfff ffff |
02ff |
1
|
1,2 |
SWAPF |
f,d |
Swap nibbles in f |
|
00 1110 dfff ffff |
0Eff |
1
|
1,2 |
XORWF |
f,d |
Exclusive OR W with f |
Z |
00 0110 dfff ffff |
06ff |
1
|
1,2 |
Note 1 : Quand un registre d’entrées/sorties est modifié en fonction de lui-même (ex : MOVF PORTB,1), la valeur utilisée sera la valeur présente sur les broches elles-mêmes.
Note 2 : Si l’instruction est exécutée sur le registre TMR0 (et si d=1), le prédiviseur sera mis à zéro s’il est affecté au module Timer0.
Mise Ă jour le Mardi, 06 Avril 2010 09:35
Instructions sur les registres bit Ă bit
Mercredi, 30 Décembre 2009 11:22
jlf
Instructions sur les registres bit Ă bit

Mnémonique
|
Opérandes
|
Description
|
Bits d'état
|
Opcode Binaire
|
Opcode Hex
|
Cycles
|
Notes
|
BCF |
f,d |
Bit Clear f |
|
01 00bb bfff ffff |
1bff |
1
|
1,2 |
BSF |
f,d |
Bit Set f |
|
01 01bb bfff ffff |
1bff |
1
|
1,2 |
BTFSC |
f,d |
Bit Test f, Skip if Clear |
|
01 10bb bfff ffff |
1bff |
1(2)
|
3 |
BTFSS |
f,d |
Bit Test f, Skip if Set |
|
01 11bb bfff ffff |
1bff |
1(2)
|
3 |
Note 1 : Quand un registre d’entrées/sorties est modifié en fonction de lui-même (ex : MOVF PORTB,1), la valeur utilisée sera la valeur présente sur les broches elles-mêmes.
Note 2 : Si l’instruction est exécutée sur le registre TMR0 (et si d=1), le prédiviseur sera mis à zéro s’il est affecté au module Timer0.
Note 3 : Si la condition de test est vrai, l’instruction suivante est ignorée et est traitée comme un NOP.Dans ce cas l’exécution nécessite deux cycles.
Mise Ă jour le Mardi, 06 Avril 2010 09:36
Instructions de contrĂ´le et literal
Mercredi, 30 Décembre 2009 11:34
jlf
Instructions de contrĂ´le et literal


Mnémonique
|
Opérandes
|
Description
|
Bits d'état
|
Opcode Binaire
|
Opcode Hex
|
Cycles
|
Notes
|
ADDLW |
k |
Add literal and W |
C,DC,Z |
11 111x kkkk kkkk |
3Ekk |
1
|
|
ANDWL |
k |
AND literal with W |
Z |
11 1001 kkkk kkkk |
39kk |
1
|
|
CALL |
k |
Call subroutine |
|
10 0kkk kkkk kkkk |
2kkk |
2
|
|
CLRWDT |
|
Clear Watchdog Timer |
TO,PD |
00 0000 0110 0100 |
0064 |
1
|
|
GOTO |
k |
Go to address |
|
10 1kkk kkkk kkkk |
2kkk |
2
|
|
IORRLW |
k |
Inclusive OR literal with W |
Z |
11 1000 kkkk kkkk |
38kk |
1
|
|
MOVLW |
k |
Move literal to W |
|
11 00xx kkkk kkkk |
30kk |
1
|
|
RETFIE |
|
Return from interrupt |
|
00 0000 0000 1001 |
0009 |
2
|
|
RETLW |
k |
Return with literal in W |
|
11 01xx kkkk kkkk |
34kk |
2
|
|
RETURN |
|
Return from Subroutine |
|
00 0000 0000 1000 |
0008 |
2
|
|
SLEEP |
|
Go into standby mode |
TO,PD |
00 0000 0110 0011 |
0063 |
1
|
|
SUBLW |
k |
Subtract W from literal |
C,DC,Z |
11 110x kkkk kkkk |
3Ckk |
1
|
|
XORLW |
k |
Exclusive OR literal with W |
Z |
11 1010 kkkk kkkk |
3Akk |
1
|
|
OPTION |
|
Load Option Register |
|
00 0000 0110 0010 |
0062 |
1
|
4 |
TRIS |
f |
Load Tris Register |
|
00 0000 0110 0fff |
006f |
1
|
4 |
Note 4 : Ces instructions ne doivent être utilisées que pour les circuits 16C5x, toutefois elles sont interprétées correctement par le 16C84 et le 16F84 afin d’assurer la compatibilité. Elles ne figurent pas dans le jeu des 16F87x. De façon générale, les instructions OPTION et TRIS sont remplacées par un MOVWF puisque les registres OPTION et TRIS sont directement accessibles dans les versions Mid-Range.
Â
Mise Ă jour le Mardi, 06 Avril 2010 09:38
|
|