Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
hi,I want to save a bank2 GP Register address ex: 110h in a register & later time i want to move that address to fsr.
Movlw 110h
movwf STORE
mplab says argument is out of range.
I want to save a bank2 GP Register address ex: 110h in a register & later time i want to move that address to fsr.
Movlw 110h
movwf STORE
mplab says argument is out of range.
bsf STATUS,IRP ; bit 7 of STATUS
Clear_RAM_B2 movlw 0x10 ; 110h
movwf FSR
movlw .96
movwf Counter
call Clear_RAM_Loop
Clear_RAM_B3 movlw 0x90 ; 190h
movwf FSR
movlw .96
movwf Counter
call Clear_RAM_Loop
bcf STATUS,IRP ; bit 7 of STATUS
return
Clear_RAM_Loop clrf INDF
incf FSR,F
decfsz Counter,F
goto Clear_RAM_Loop
return
bsf STATUS,IRP ;banks 2 & 3
movlw 0x10 ;start at 0x110
movwf FSR
ClrLoop clrf INDF ;clear bank 2
bsf FSR,7 ;move to back 3
clrf INDF ;clear bank 3
bcf FSR,7 ;back to bank 2
incf FSR,f ;move to next location
movlw 0x70 ;end of bank 2 & 3
xorwf FSR,w ;reached end yet?
btfss STATUS,Z
goto ClrLoop ;no, so loop
bsf STATUS,IRP ; banks 2-3
movlw 0x90 ;
clr movwf FSR ;
clrf INDF ; clear 0x190..0x1FF
bcf FSR,7 ;
clrf INDF ; clear 0x110..0x17F
addlw 1 ;
skpz ;
goto clr ;
Hi Suraj143,
Would this work for you? Is it ok to clear 170..17F and 1F0..1FF ranges in your application?
Regards, Mike
Code:bsf STATUS,IRP ; banks 2-3 movlw 0x90 ; clr movwf FSR ; clrf INDF ; clear 0x190..0x1FF bcf FSR,7 ; clrf INDF ; clear 0x110..0x17F addlw 1 ; skpz ; goto clr ;