#INCLUDE P18F452.INC Org 00H N1 EQU 0X25 CLRF Trisb
#INCLUDE P18F452.INC Org 00H N1 EQU 0X25 CLRF Trisb
#INCLUDE P18F452.INC Org 00H N1 EQU 0X25 CLRF Trisb
INC
ORG 00H
N1 EQU 0X25
CLRF TRISB;
L1:SETF PORTB
CALL DELAY
CLRF PORTB
CALL DELAY
GOTO L1
DELAY:
MOVLW D'250'
MOVWF N1
BACK:DECFSZ N1,F
GOTO BACK
RET
END
ADDING
#INCLUDE P18F452.INC
ORG 00H
CLRF TRISB,0
MOVLW D'10'
MOVWF COUNT
MOVLW 0
AGAIN:ADDLW 3
DECFSZ COUNT,F
GOTO AGAIN
MOVWF PORTB
END
ARITHEMETIC
#INCLUDE P18F452.INC
ORG 00H
MOVF 0X79,W
ANDWF NUM2,W
MOVWF 81H
COMF 81H,W
MOVWF 82H
MOVF 0X78,W
IORWF NUM2,W
MOVWF 83H
COMF 83H,W
MOVWF 84H
MOVF 0X78,W
XORWF NUM2,W
MOVWF 85H
COMF 85H,W
MOVWF 86H
MOVF 0X78,W
ADDWF NUM2,W
MOVWF 87H
MOVF 0X78,W
SUBWF NUM2,W
MOVWF 88H
MOVF 0X78,W
SWAPF 89H
END
BUZZER
#INCLUDE P18F452.INC
ORG 00H
BSF TRISB,0
BCF TRISC,7
AGAIN:BTFSC PORTB,0
BRA AGAIN
BSF PORTC,7
BCF PORTC,7
GOTO AGAIN
END