I found that 16f1455 has a MOVIW instruction

MOVWI n mm

Move Indirect FSRn to W with pre/post inc/dec
modifier, mm

but the compiler doesn't support it I guess.

Sunish


On Wed, Mar 20, 2013 at 12:10 PM, Oliver Seitz <[email protected]> wrote:

>
> **
>
>  postinc is available only on 18f .
>
> This is true, but there is an INDF1 register on the 16f1455, so it can be
> done without uising assembler (as long as the compiler still does not use
> INDFs other than INDF0 )
>
> This could work (untested):
>
>
>
>
> procedure _usb_copy_array_to_ram(word in dst, byte in data[], byte in
> num_bytes ) is
>     -- pragma inline
>     var byte index
>     var byte dst_ptr[2] AT dst
>
>     FSR1L = dst_ptr[0]
>     FSR1H = dst_ptr[1]
>
>     for num_bytes using index loop
>         INDF1 = data[index]
>         FSR1L=FSR1L+1
>         if FSR1L==0 then
>            FSR1H=FSR1H+1
>         end if
>     end loop
> end procedure
>
>
>  The "clean" ways, which would not be in danger of breaking with a future
> compiler update would indeed either be support for pointers in JAL, or
> doing the copying in assembler.
>
>
> Greets,
> Kiste
>
>    --
> You received this message because you are subscribed to the Google Groups
> "jallib" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/jallib?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/jallib?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to