;************************************
; written by: *
; date: *
; version: *
; file saved as: *
; for PIC… *
; clock frequency: *
;************************************
; PROGRAM FUNCTION: _______________________________________
;______________________________________________________________
list p=16F84A
include "p16F84A.inc"
;============
; Declarations:
porta EQU 05 ; not needed - specified in the include 16f84A
portb EQU 06 ; not needed - specified in the include 16f84A
; use registers
op EQU 0c
org 0x00 ; NEW CODE
goto Start ; NEW CODE
;===========
; Subroutines:
Init
banksel TRISA ;NEW CODE - to select the correct "BANK"
movlw b'0000'
movwf TRISA
movlw b'11111111'
movwf TRISB
banksel 0 ; NEW CODE - to return to BANK 0
retlw 0
;=============
; Program Start:
Start call Init
Main movf portb,w
andlw b'00001111'
movwf op
swapf portb,F
movf portb,w
andlw b'00001111'
addwf op,F
movf op,w
movwf porta
goto Main
END