Site Logo Home
 
rOm
Quest
Glossary
 
Random
Page
Search
Site
Lush
Sim
Class
Subject
Images
 
Help
FAQ
Sign
Up
Log
In
A Level     Microcontroller     Architecture     >Instruction Set<     Memory     ~ BSF and BCF     ~ Call and Return     ~ COMF     ~ Counting     ~ Heater     ~ INCF and BTFSC     ~ INT0IF     ~ LED Matrix     ~ Motor     ~ Stepper Motor    

Microcontroller Instruction Set


Site for Eduqas/WJEC - Go to the AQA site.

  A Level    Microcontrollers  0 of 92    Question 752    Assembler 1 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set1 of 92    Question 753    Assembler 1 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set2 of 92    Question 754    Assembler 1 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set3 of 92    Question 762    Assembler 1 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set4 of 92    Question 758    Assembler 1 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set5 of 92    Question 757    Assembler 1 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set6 of 92    Question 756    Assembler 1 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set7 of 92    Question 755    Assembler 1 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set8 of 92    Question 847    Assembler 2 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set9 of 92    Question 846    Assembler 2 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set10 of 92    Question 845    Assembler 2 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set11 of 92    Question 844    Assembler 2 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set12 of 92    Question 763    Assembler 2 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set13 of 92    Question 764    Assembler 2 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set14 of 92    Question 765    Assembler 2 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set15 of 92    Question 766    Assembler 2 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set16 of 92    Question 767    Assembler 2 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set17 of 92    Question 783    Assembler 3 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set18 of 92    Question 784    Assembler 3 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set19 of 92    Question 785    Assembler 3 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set20 of 92    Question 781    Assembler 3 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set21 of 92    Question 782    Assembler 3 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set22 of 92    Question 848    Assembler 3 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set23 of 92    Question 849    Assembler 4 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set24 of 92    Question 841    Assembler 4 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set25 of 92    Question 839    Assembler 4 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set26 of 92    Question 838    Assembler 4 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set27 of 92    Question 786    Assembler 4 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set28 of 92    Question 858    Assembler 5 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set29 of 92    Question 862    Assembler 5 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set30 of 92    Question 861    Assembler 5 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set31 of 92    Question 860    Assembler 5 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set32 of 92    Question 859    Assembler 5 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set33 of 92    Question 855    Assembler 5 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set34 of 92    Question 854    Assembler 5 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set35 of 92    Question 853    Assembler 5 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set36 of 92    Question 852    Assembler 5 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set37 of 92    Question 851    Assembler 5 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set38 of 92    Question 850    Assembler 5 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set39 of 92    Question 866    Assembler 6 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set40 of 92    Question 867    Assembler 6 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set41 of 92    Question 868    Assembler 6 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set42 of 92    Question 869    Assembler 6 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set43 of 92    Question 870    Assembler 6 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set44 of 92    Question 871    Assembler 6 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set45 of 92    Question 872    Assembler 6 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set46 of 92    Question 1448    Assembler 6 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set47 of 92    Question 897    Assembler 9 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set48 of 92    Question 898    Assembler 9 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set49 of 92    Question 899    Assembler 9 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set50 of 92    Question 596    Bus Architecture 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set51 of 92    Question 534    Bus Architecture 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set52 of 92    Question 630    Bus Architecture 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set53 of 92    Question 631    Bus Architecture 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set54 of 92    Question 632    Bus Architecture 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set55 of 92    Question 633    Bus Architecture 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set56 of 92    Question 634    Bus Architecture 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set57 of 92    Question 1438    Bus Architecture 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set58 of 92    Question 1437    Bus Architecture 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set59 of 92    Question 635    Bus Architecture 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set60 of 92    Question 528    Bus Data Directions 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set61 of 92    Question 531    Bus Read and Write 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set62 of 92    Question 530    Bus Read and Write 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set63 of 92    Question 532    Bus Width Calculation 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set64 of 92    Question 578    Compare Polling with Interrupts 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set65 of 92    Question 479    Compare Polling with Interrupts 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set66 of 92    Question 533    Identifying Buses 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set67 of 92    Question 529    Identifying Buses 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set68 of 92    Question 527    Identifying Buses 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set69 of 92    Question 670    Latches Connected to BUS 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set70 of 92    Question 669    Latches Connected to BUS 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set71 of 92    Question 725    Microcontroller - Address Bus 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set72 of 92    Question 724    Microcontroller - Advantages 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set73 of 92    Question 723    Microcontroller - Advantages 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set74 of 92    Question 387    Microcontroller - Architecture 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set75 of 92    Question 386    Microcontroller - Architecture 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set76 of 92    Question 385    Microcontroller - Architecture 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set77 of 92    Question 719    Microcontroller - Binary 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set78 of 92    Question 727    Microcontroller - Memory 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set79 of 92    Question 728    Microcontroller - Memory 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set80 of 92    Question 721    Microcontroller - Terminology 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set81 of 92    Question 900    Microcontroller - Terminology 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set82 of 92    Question 1430    Microcontroller - Terminology 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set83 of 92    Question 1431    Microcontroller - Terminology 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set84 of 92    Question 1432    Microcontroller - Terminology 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set85 of 92    Question 1433    Microcontroller - Terminology 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set86 of 92    Question 1434    Microcontroller - Terminology 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set87 of 92    Question 1435    Microcontroller - Terminology 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set88 of 92    Question 1436    Microcontroller - Terminology 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set89 of 92    Question 722    Microcontroller - Terminology 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set90 of 92    Question 1031    Robots and Machines 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set91 of 92    Question 300    Sub-systems 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set92 of 92    Question 310    Sub-systems Recognition 
Score 0/0 
Not attempted  
Last Answer  
Deadline not set  Questions 0 to 92   -->  View All  

Microchip 8 bit microcontrollers have a reduced instruction set with only 32 instructions for arithmetic, logic, data moves and simple decisions.

The Microchip Instruction Set Data Sheet contains detailed information about each available instruction.

GOTO Fail    Thanks xkcd.

The Instruction Set

Mnemonics in UPPER CASE are included in the WJEC/Eduqas data Booklet.    PIC16F88 Data Sheet See page 150.
(* NOP) SLEEP and CLRWDT run as NOP operations. The releatd registers and flags have not been implemented.

Op Operand/s Description                Cycles Bits               Flags     Included in the WJEC Data Booklet
|       |    |                            |    |                  |         |
|       |    |                            |    |                  |         |
config1 -    Config Register at 0x02      0    11 1111 0101 0000  |         |   
config2 -    Config Register at 0x03      0    11 1111 1111 1111  |         |   
                                                                  |         |
clrw    -    Clear W                      1    00 0001 0xxx xxxx  Z         |   
clrwdt  -    Clear Watchdog Timer (* NOP) 1    00 0000 0110 0100     TO,PD  |   
NOP     -    No Operation                 1    00 0000 0xx0 0000            WJEC
RETFIE  -    Return from interrupt        2    00 0000 0000 1001            WJEC
RETURN  -    Return from Subroutine       2    00 0000 0000 1000            WJEC
sleep   -    Go into Standby mode (* NOP) 1    00 0000 0110 0011     TO,PD      

CLRF    f    Clear f                      1    00 0001 lfff ffff  Z         WJEC
MOVWF   f    Move W to f                  1    00 0000 lfff ffff            WJEC

BCF     f, b Bit Clear f                  1    01 00bb bfff ffff            WJEC
BSF     f, b Bit Set f                    1    01 01bb bfff ffff            WJEC
BTFSC   f, b Bit Test f, Skip if Clear    1(2) 01 10bb bfff ffff            WJEC
BTFSS   f, b Bit Test f, Skip if Set      1(2) 01 11bb bfff ffff                

addwf   f, d Add W and f                  1    00 0111 dfff ffff  Z, DC, C      
andwf   f, d AND W with f                 1    00 0101 dfff ffff  Z             
COMF    f, d Complement f                 1    00 1001 dfff ffff  Z         WJEC
decf    f, d Decrement f                  1    00 0011 dfff ffff  Z             
DECFSZ  f, d Decrement f, Skip if 0       1(2) 00 1011 dfff ffff            WJEC
INCF    f, d Increment f                  1    00 1010 dfff ffff  Z         WJEC
incfsz  f, d Increment f, Skip if 0       1(2) 00 1111 dfff ffff                
iorwf   f, d Inclusive OR W with f        1    00 0100 dfff ffff  Z             
MOVF    f, d Move f                       1    00 1000 dfff ffff  Z             
rlf     f, d Rotate Left f through Carry  1    00 1101 dfff ffff         C      
rrf     f, d Rotate Right f through Carry 1    00 1100 dfff ffff         C      
subwf   f, d Subtract W from f            1    00 0010 dfff ffff  Z, DC, C      
swapf   f, d Swap nibbles in f            1    00 1110 dfff ffff                
xorwf   f, d Exclusive OR W with f        1    00 0110 dfff ffff  Z             

ADDLW   k    Add literal and W            1    11 111x kkkk kkkk  Z, DC, C  WJEC
ANDLW   k    AND literal with W           1    11 1001 kkkk kkkk  Z         WJEC
CALL    k    Call subroutine              2    10 0kkk kkkk kkkk            WJEC
GOTO    k    Go to address                2    10 1kkk kkkk kkkk            WJEC
IORLW   k    Inclusive OR literal with W  1    11 1000 kkkk kkkk  Z         WJEC
MOVLW   k    Move literal to W            1    11 00xx kkkk kkkk            WJEC
retlw   k    Return with literal in W     2    11 01xx kkkk kkkk                
SUBLW   k    Subtract W from literal      1    11 110x kkkk kkkk  Z, DC, C  WJEC
xorlw   k    Exclusive OR literal with W  1    11 1010 kkkk kkkk  Z             

CONSTANTS DEFINED IN THE HEADER FILE

W       EQU       0
F       EQU       1

; ===== INTCON =====
GIE     EQU    0x80    ; Global Interrupt Enable
PEIE    EQU    0x40    ;       Peripheral Interrupt Enable          (not implemented)
TMR0IE  EQU    0x20    ;       Timer 0 Interrupt Enable             (not implemented)
INT0IE  EQU    0x10    ; INT0 Interrupt Enable, used with RB0/INT
RBIE    EQU       8    ;       RB or Port B Change Interrupt Enable (not implemented)
TMR0IF  EQU       4    ;       Timer 0 Interrupt FLAG (not used)
INT0IF  EQU       2    ; INT0 Interrupt FLAG, used with RB0/INT
RBIF    EQU       1    ;       RB or Port B Interrupt FLAG          (not implemented)

; ===== STATUS =====
IRP     EQU    0x80    ;                                            (not implemented)
RP1     EQU    0x40    ;                                            (not implemented)
RP0     EQU    0x20    ;                                            (not implemented)
TO      EQU    0c10    ;                                            (not implemented)
PD      EQU       8    ;                                            (not implemented)
Z       EQU       4    ; Zero flag is set if a move or calculation gives a zero result.
DC      EQU       2    ;                                            (not implemented)
C       EQU       1    ; Carry flag is set if a calculation gives a negative result or one too big to fit in 8 bits.

; ===== SPECIAL PURPOSE REGISTER ADDRESSES =====
PCL     EQU       2    ; The Program Counter
STATUS  EQU       3    ; The Status Register
PORTA   EQU       5    ; PORTA for I/O
PORTB   EQU       6    ; PORTB for I/O
TRISA   EQU       5    ; Data Direction for PORTA
TRISB   EQU       6    ; Data Direction for PORTB
INTCON  EQU    0x0B    ; The Interrupt Controller Register

Literals can be ...

0x25 (25 hexadecimal - recommended)
h'25' (25 hexadecimal)
d'37' (37 as a normal decimal number)
37 (a normal decimal mumber)
b'00100101' (a binary number which just happens to be 37 or 0x25 - recommended)

MyCount EQU 0x22    Literals can be given a name. Here the general purose register at address 0x22 is named MyCount.

Subject Name     Level     Topic Name     Question Heading     First Name Last Name Class ID     User ID    

fff
Home
<<<
ppw
Pg Up
<<
ppp
Up
<
|||

>|<
nnn
Down
>
nnw
Pg Down
>>
lll
End
>>>

Close
Escape
X

Q: qNum of last_q     Q ID: Question ID         Score: num correct/num attempts         Date Done    

 

Submit
Enter

 

Question Text

image url

 


Help Link

Add     Delete     Clone     Edit     Hardness

Help Text
Debug


 

 

 

Contact, Copyright, Cookies and Legalities: C Neil Bauers - reviseOmatic V4 - © 2016/17

Hosted at linode.com - London

 

Please report website problems to Neil