You need to be writing your code a bit differently. First thing is that it should always have an include file and you should be using the proper equates from the include file. At the top of every asm program you write should be this line:
Navigate to (typically) c:\program files\microchip\mpasm suite, open the p16f628a.inc file and have a look (there's an inc file for every model of PIC - use the appropriate one for your PIC). Get in the habit of using those equate symbols instead of the actual hex numbers in your code. Makes the code
much more readable and less prone to errors. You'll spend much less time trying to remember what the numbers are and be able to tell at a glance what registers you're manipulating.
Another trick to make things easier to read is to use the banksel directive to generate the bank select code, rather than diddling the bits yourself. Here's an example of what it looks like in a snip of some 16F886 code I recently wrote:
Code:
list p=16F886
include <p16F886.inc>
.
.
.
banksel OSCCON ;bank 1
movlw b'01110001' ;8MHz internal clock
movwf OSCCON
movlw b'00011111'
movwf TRISA
movlw b'11000000'
movwf TRISB
movlw b'11011011'
movwf TRISC
movlw b'10000000' ;config ADC voltage ref and data justification
movwf ADCON1
banksel ANSEL ;bank 3
movlw b'00000001'
movwf ANSEL
banksel PORTC ;bank 0
movlw b'00000001' ;enable ADC
movwf ADCON0
Using the above suggestions, this:
Code:
bsf 03h,5
movlw 00h
movwf 86h
bcf 03h,5
would look like this:
Code:
banksel TRISB ;bank 1
movlw 0x00
movwf TRISB
banksel PORTA ;bank 0
or better yet:
Code:
banksel TRISB ;bank 1
clrf TRISB
banksel PORTA ;bank 0
Much clearer what's going on now, right? You'll especially appreciate it when you come back to this code six months later when it's not fresh in your mind anymore.
(I changed two lines into one by using clrf instead of the two lines you used.)
You're using the h suffix (00h) for hex, like a Motorola programmer. That's fine too, but most PIC programmers use a 0x prefix (0x00) for hex. Took me a while to get used to that. Either one is fine. If your assembler's radix is set correctly you don't need any prefix or suffix at all, though I still do it just to be absolutely clear. I believe the default radix for MPLAB is hex.