I am new on this forum and also new to learn pic asembly programming.
So, to learn asembly programming i start to make simple programs, like the program below (add the first ten numbers).
For this program i select PIC16F916 because i have a development board with this controller.
START
movlw 0x00
movwf MYVAR1
addwf MYVAR1, 0
Label incf MYVAR1, 1
addwf MYVAR1, 0
btfss MYVAR1, 3
goto Label
btfss MYVAR1, 1
goto Label
GOTO $
END
The program is ok.
But now i try to make a program to add the first 100 numbers.
Because the registers are on 8 bits of course that the result is not that i expected (overflow).
So, there is a solution to make the sum of the first 100 numbers ?
Look what i have done :
START
movlw 0x00
movwf MYVAR1
addwf MYVAR1, 0
Label incf MYVAR1, 1
addwf MYVAR1, 0
btfss MYVAR1, 6
goto Label
btfss MYVAR1, 5
goto Label
btfss MYVAR1, 2
goto Label
GOTO $
END