Searching \ for 'fsr' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: techref.massmind.org/techref/index.htm?key=fsr
Search entire site for: 'fsr'.

Truncated match.
PICList Thread
'fsr'
1998\04\06@122145 by andre

flavicon
face
Hi to all engineers.

I need to know more about fsr.
this is what I know.
Fsr is a software register that can hold up to 255 difference values or
registers.
you can store them and you can call them by using INDF instruction.
Am I right?

this is what I do not know.
1. what is the real purpose of this? when do you use it?
2. when you store values how does it organize.

for example.

movlw     0x01
movwf    fsr
movlw    0x02
movwf    fsr
movlw    0x03
movwf    fsr

is this means that fsr (file select register) saved all 3  values or
only the last one?
could you please explaine more.

Andre                        thank you

1998\04\06@122145 by andre

flavicon
face
Hi to all engineers.

I need to know more about fsr.
this is what I know.
Fsr is a software register that can hold up to 255 difference values or
registers.
you can store them and you can call them by using INDF instruction.
Am I right?

this is what I do not know.
1. what is the real purpose of this? when do you use it?
2. when you store values how does it organize.

for example.

movlw     0x01
movwf    fsr
movlw    0x02
movwf    fsr
movlw    0x03
movwf    fsr

is this means that fsr (file select register) saved all 3  values or
only the last one?
could you please explaine more.

Andre                        thank you

1998\04\06@140550 by Hardy/Rafael Pinto

flavicon
face
>Hi to all engineers.


   Hiya, Howdy?

>
>I need to know more about fsr.
>this is what I know.
>Fsr is a software register that can hold up to 255 difference values or
>registers.
>you can store them and you can call them by using INDF instruction.
>Am I right?

   The definition is OK... Go on
>
>this is what I do not know.
>1. what is the real purpose of this? when do you use it?
>2. when you store values how does it organize.
>

   1. You use to do Indirect register access. An example:


   movlw     0x20
   movf    fsr,f
   movlw    0xAB
   movf    indf,w

   This program loads 0xAB into the register 0x20. This can be used when
you want to store a table using RAM file registers. FSR points to the
register and INDF is the contents of the register.

   2. The value wrote in the INDF is stored in the register indicated by
the value of FSR.

{Quote hidden}

   This would do nothing! unless you write something to INDF, nothing is
done!

>Andre                        thank you
>

   Anytime!

   Rafael Pinto

1998\04\06@172510 by andre

flavicon
face
Hi HardyThank you for your explanations  and example.
I think line 2 instead of movf should be movwf.
unless           movf    fsr,w


Andre


{Quote hidden}

1998\04\07@070734 by Caisson

flavicon
face
> Van: Andre Abelian <spam_OUTandreTakeThisOuTspamcompufire.com>
> Aan: .....PICLISTKILLspamspam@spam@MITVMA.MIT.EDU
> Onderwerp: fsr
> Datum: maandag 6 april 1998 16:53
>
> Hi to all engineers.
>
> I need to know more about fsr.
> this is what I know.
> Fsr is a software register that can hold up to 255 difference values or
> registers.
> you can store them and you can call them by using INDF instruction.
> Am I right?

Ehhh... Sort of.  The FSR is an register that can (as all other registers)
hold
a number ranging from 0x00 (0 decimal) thru 0xFF (255 decimal).

The INDF register does the same.

Now the tricky part :

The data stored into INDF will _not_ be stored at adres 0x00 (where INDF
is located), but at the adres FSR points to.

Example:

movlw 0x50
movwf FSR
incf INDF

This will increment Register 0x50 by one.

movlw 0x03
movwf FSR
btfss INDF,0
goto {somewhere}

This will branch to {somewhere} if the carry is not set.
(register 0x03 is the Status-register, bit 0 is the Carry-flag)

> this is what I do not know.
> 1. what is the real purpose of this? when do you use it?

Observe the next routine :

 movlw 0x20
 movwf FSR
 goto CharOut2
CharOut1:
movf INDF,w
 {write the character to LCD, RS232, etc}
 inc FSR
CharOut2:
 movf INDF
 btfss STATUS,Z
 goto CharOut1

This routine will output bytes (the routine between {} ) found at 0x20 and
on,
stopping when it encounters a 0x00 byte (movf INDF , btfss STATUS,Z)

Very handy if you want to write text from an internal buffer to a LCDisplay

The other way around, you could receive bytes from an RS232 connection,
and save them in internal memory by using an
 movwf INDF
 inc FSR
combination.

{Quote hidden}

This example loads 0x03 in FSR.  All other values where overwritten by the
last one.  In this way you are using the FSR register as a normal (not
dedicated) storage register.

> could you please explaine more.
>
See & read the above ;-)

> Andre                        thank you

Need to know more ? Just tell us/me ...

Greetz,
 Rudy Wieser

1998\04\07@133027 by Hardy e/ou Rafael Pinto

flavicon
face
Ok...the code is

    movlw     0x20
    movwf    fsr
    movlw    0xAB
    movwf    indf

Rafael Pinto


{Original Message removed}

More... (looser matching)
- Last day of these posts
- In 1998 , 1999 only
- Today
- New search...