Searching \ for '[PIC] question for ASM experts' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/languages.htm?key=asm
Search entire site for: 'question for ASM experts'.

Exact match. Not showing close matches.
PICList Thread
'[PIC] question for ASM experts'
2009\01\30@154113 by Thomas C. Sefranek

face picon face
What does...

       MOVF        POSTINC1

Do?

The machine code produced is 0X52E6.

Which (I believe) translates to (Copy) the (not a real register) POSTINC1 to
where FSR1 is pointing and then increment FSR1.

I found this in my code, I didn't MEAN to do this,
(I really wanted to DECRIMENT the FSR.)

I believe the FSR is not a byte register available to be MOVed.
I can imagine the LSB of the FSR could be copied...
It generated no warning or error, and "Something" happens when I run it.

I have not yet used the tools to actually LOOK at what is happening, I will,
but I thought I'd throw this out to the group.

Tom

 *
 |  __O    Thomas C. Sefranek  spam_OUTWA1RHPTakeThisOuTspamARRL.NET
 |_-\<,_   Amateur Radio Operator: WA1RHP
 (*)/ (*)  Bicycle mobile on 145.41MHz PL74.4

ARRL Instructor, Technical Specialist, VE Contact.
hamradio.cmcorp.com/inventory/Inventory.html
http://www.harvardrepeater.org


2009\01\30@155324 by solarwind

picon face
On Fri, Jan 30, 2009 at 3:41 PM, Thomas C. Sefranek <.....tcsKILLspamspam@spam@cmcorp.com> wrote:
> What does...
>
>        MOVF    POSTINC1
>
> Do?

I believe that would be invalid as movf takes two arguments:

movf  file, (0 or 1)

--
solarwind

2009\01\30@160016 by Jinx

face picon face
> What does...
>
> MOVF POSTINC1
>
> do?

MOVF POSTINC1 = INCF FSR1

2009\01\30@161808 by Harold Hallikainen

face
flavicon
face

>> What does...
>>
>> MOVF POSTINC1
>>
>> do?
>
> MOVF POSTINC1 = INCF FSR1
>


I think this is correct. The POSTINC1 should be followed by w or f, but if
it is not specified, it is understood to be f.

So, the instruction becomes:
copy the contents pointed to by FSR1 to the location pointed to by FSR1,
then increment FSR1.

Harold



--
FCC Rules Updated Daily at http://www.hallikainen.com - Advertising
opportunities available!

2009\01\30@162421 by olin piclist

face picon face
Thomas C. Sefranek wrote:
> What does...
>
> MOVF POSTINC1
>
> Do?

It will set the Z and N status bits according to the byte pointed to by
FSR1, then increment FSR1 by 1, and take one instruction cycle doing all
this.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.

2009\01\30@162728 by olin piclist

face picon face
solarwind wrote:
>> What does...
>>
>>        MOVF    POSTINC1
>>
>> Do?
>
> I believe that would be invalid as movf takes two arguments:

No, the second argument is optional and defaults to F.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.

2009\01\30@162818 by olin piclist

face picon face
Jinx wrote:
> MOVF POSTINC1 = INCF FSR1

In addition to setting the Z and N status bits according to the byte at
where FSR1 was originally pointing.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.

2009\01\30@210308 by Jinx

face picon face
> I have not yet used the tools to actually LOOK at what is
> happening

As mentioned, MOVF POSTINCx = INCF FSRx. It would be a
handy instruction as a 16-bit FSR increment. FSRxL is incremented
and also FSRxH when FSRxL rolls over. INCF FSRxL doesn't roll
over into FSRxH

Executing the equivalent INCF FSRx does not do anything to FSRx,
not for the 18F1320 anyway, and no compilation error or warning

INCF FSR0 = 2A00 INCF A,F,ACCESS
INCF FSR1 = 2A01 INCF ADCS1,F,ACCESS
INCF FSR2 = 2A02 INCF ADCS2,F,ACCESS

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