Hi, I need some help with a task on my electronics course at college. The program underneath should multiply 3 and 2 to make 6 but instead I get 9. Could anyone help correct this please and then turn it into a linear program. Thank you!
cblock 0x20
first
second
endc
org 0
Start:
bsf STATUS,RP0
clrf TRISC
bcf STATUS,RP0
movlw 0x03
movwf first
movlw 0x02
movwf second
call addloop
movwf PORTC
addloop:
movwf first
again:
addwf first
decfsz second
goto again
return
end
cblock 0x20
first
second
endc
org 0
Start:
bsf STATUS,RP0
clrf TRISC
bcf STATUS,RP0
movlw 0x03
movwf first
movlw 0x02
movwf second
call addloop
movwf PORTC
addloop:
movwf first
again:
addwf first
decfsz second
goto again
return
end