org 0x000
goto Start
org 0x04
goto ISR
Start org 0x020
bsf STATUS, 5
bcf STATUS, 6
movlw 0x87
movwf OPTION_REG
movlw 0x00
movwf TRISD
movlw 0x0f
movwf TRISC
movlw 0x06
movwf ADCON1
bcf STATUS, 5
bcf STATUS, 6
clrf PORTD
clrf PORTC
movlw 0xa0
movwf INTCON
goto Main
Main
goto Main
LoopTimer
btfss INTCON, 2
ISR
nop
bcf INTCON, 2
incf PORTD, f
retfie
end
goto Start
org 0x04
goto ISR
Start org 0x020
bsf STATUS, 5
bcf STATUS, 6
movlw 0x87
movwf OPTION_REG
movlw 0x00
movwf TRISD
movlw 0x0f
movwf TRISC
movlw 0x06
movwf ADCON1
bcf STATUS, 5
bcf STATUS, 6
clrf PORTD
clrf PORTC
movlw 0xa0
movwf INTCON
goto Main
Main
goto Main
LoopTimer
btfss INTCON, 2
ISR
nop
bcf INTCON, 2
incf PORTD, f
retfie
end
The bolded part, I believe I got it, just wondering if people ever worked with this language before. Anyway, nop does nothing, but if removed, the program stops running. I think it is because btfss(bit test f, skip if set), if it is set, it will skip so nop is just there so it can be skipped. Am I correct? Second part, a friend of mine(this is not homework, it's a program I am writing) said that TMR0 runs in the background, even though it does not show. It is kind of true but why isn't it in the program? Main will loop into itself 256 times then goes back in the beginning, so basically my second question is this: where in the program does it increment?(not program count)