Hi! how can i decrement the binary value 1010001011000010101? i'm using a PIc 16F877. my idea is to breack the number into 3 bytes! but if i do that is it still the same number?
this is what i did:
LIST p=16F877
#include <P16F877.inc>
__config _XT_OSC & _PWRTE_ON & _WDT_OFF &_LVP_OFF
;*****Equates**********************************************
status equ 03h
PortD equ 08h
TRISD equ 88h
count1 equ 22h
count2 equ 23h
count3 equ 24h
;******Main Program****************************************
org 10h
bsf status,RP0
movlw B'00000000'
movwf TRISD
bcf status, RP0
start
bsf PortD,0
call delay
bcf PortD,0
call delay
goto start
delay
movlw B'10100010'
movwf count1
movlw B'11000010'
movwf count2
movlw B'00000101'
movwf count3
loop1
decfsz count1,1
goto loop1
loop2
decfsz count2,1
goto loop2
loop3
decfsz count3,1
goto loop3
return
end
this is what i did:
LIST p=16F877
#include <P16F877.inc>
__config _XT_OSC & _PWRTE_ON & _WDT_OFF &_LVP_OFF
;*****Equates**********************************************
status equ 03h
PortD equ 08h
TRISD equ 88h
count1 equ 22h
count2 equ 23h
count3 equ 24h
;******Main Program****************************************
org 10h
bsf status,RP0
movlw B'00000000'
movwf TRISD
bcf status, RP0
start
bsf PortD,0
call delay
bcf PortD,0
call delay
goto start
delay
movlw B'10100010'
movwf count1
movlw B'11000010'
movwf count2
movlw B'00000101'
movwf count3
loop1
decfsz count1,1
goto loop1
loop2
decfsz count2,1
goto loop2
loop3
decfsz count3,1
goto loop3
return
end