assembly - clearing memory locations with pic microcontroller -


i beginner asm , embedded systems. looking @ code meant clear memory locations using "indirection" register (or - not sure). code goes like:

     movlw 0x20     movwf fsr loop    clrf indf     incf fsr, f     btfsc fsr, 7     goto loop 

i don't incf fsr, f part. instruction incf takes 2 operands; increments value in first location, , stores result in 2nd. in case f have incremented value, why test on fsr?

f mean file register, code d (destination) select bit; d = 0: store result in w, d = 1: store result in file register f. default d = 1.

the compiler should understand:

;increment fsr byte , result store fsr     incf fsr, f     or     incf fsr, 1 ;increment fsr byte , result store w reg     incf fsr, w     or     incf fsr, 0 

Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -