Assembly Program Assembly Commands PIC 16F84A Instruction Set
Assembly Program Assembly Commands PIC 16F84A Instruction Set
Set
1
12/15/2014
Assembly Commands
composed of the following columns:
d. Comment
- always begins with a semicolon
- explanatory text on any line of code
that can help the programmer and
user to understand the program
- have no effect on the operation of
the program
Example:
MOVLW 0x5A
2
12/15/2014
Example: Example:
MOVLW 1FH MOVLW 10H
MOVWF PORTA MOVWF PORTB
BCF PORTA , 0 BSF PORTB , 4
Example: Example:
GOTO on RETURN
on MOVLW 0x0F
MOVWF PORTB
3
12/15/2014
ASSEMBLY LANGUAGE
ASSEMBLY LANGUAGE
Instructions Set
• CALL Instructions Set
- Call a program • BTFSC
Syntax: [label] CALL k - Test bit b in f, skip if it is zero
Syntax: [label] BTFSC f , b
Example:
CALL on Example:
GOTO start BTFSC PORTA , 0
on MOVLW 0x0F GOTO off
MOVWF PORTB GOTO on
RETURN
Example: Example:
BTFSS PORTA , 0 MOVLW 00H
GOTO off MOVWF PORTB
GOTO on INCF PORTB , 1
4
12/15/2014
5
12/15/2014
6
12/15/2014
7
12/15/2014