Searching \ for 'Update matters...' 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=update+matters
Search entire site for: 'Update matters...'.

Truncated match.
PICList Thread
'Update matters...'
1998\01\15@180843 by Carlos Betancourt

flavicon
face
I'm working on a routine for the 16c84. This routine, using indirect
addressing, modifies a GPR's bit. The code is:

             movf   BYTENRO,W          ; BYTENRO is the GPR address
             movwf  FSR                ; indirect addresing
             movf   BITNRO,W           ; bit to modify
             call   Tabla_1
             iorwf  INDF,1             ; bit_number OR INDF( BYTENRO's
; content )
             goto   somewhere_else
Tabla_1       addwf  PCL,1
             retlw  1                  ; bit number 0
             retlw  2                  ; bit number 1
             retlw  4                  ; bit number 2
             retlw  8                  ; bit number 3
             retlw  10                 ; bit number 4
             retlw  20                 ; bit number 5
             retlw  40                 ; bit number 6
             retlw  80                 ; bit number 7

My question is: Does the instruction "iorwf  INDF,1" updates the contents
of BYTENRO???
If it doesn't I must add "movwf  INDF"

I simulated the code with MPSim and PICSim (by DR. C.E. Wick). MPSim tells
me BYTENRO is not update; PICSim tells me it does.
I do not know which is the rigth way. Please, tell me if I am explicit
enough in this post. I hope you help me work it out.

TIA

Carlos Betancourt
CETI-UNET
Venezuela

1998\01\15@190319 by TONY NIXON 54964

flavicon
picon face
You must put the address of BYTENRO into the FSR register,
not the VALUE stored in BYTENRO, if you wish to update the contents
of BYTENRO.

Use

movlw BYTENRO
movwf FSR

Regards

Tony

For the beginner....
PicNPoke Multimedia 16F84 Simulator Assembler, and Tutorial.
Now with PicNPlay circuit simulator.
Plus animated Address Mode Tutor.

http://www.dontronics.com/picnpoke.html

1998\01\15@191219 by Andrew Warren

face
flavicon
face
TONY NIXON 54964 <spam_OUTPICLISTTakeThisOuTspamMITVMA.MIT.EDU> wrote:

> You must put the address of BYTENRO into the FSR register,
> not the VALUE stored in BYTENRO, if you wish to update the contents
> of BYTENRO.

   Whoops... Tony's absolutely correct; I didn't notice that Carlos
   has written "MOVF BYTENRO".

   -Andy

=== Andrew Warren - .....fastfwdKILLspamspam@spam@ix.netcom.com
=== Fast Forward Engineering - Vista, California
=== http://www.geocities.com/SiliconValley/2499

1998\01\15@195953 by Andrew Warren

face
flavicon
face
Carlos Betancourt <PICLISTspamKILLspamMITVMA.MIT.EDU> wrote:

>    movf   BYTENRO,W
>    movwf  FSR
>    ....
>    iorwf  INDF,1
>
> My question is: Does the instruction "iorwf  INDF,1" updates the
> contents of BYTENRO???

Carlos:

Yes, so long as BYTENRO is a general-purpose file register (rather
than a read-only special-function register or a port register whose
pins are all defined as outputs).

-Andy

=== Andrew Warren - .....fastfwdKILLspamspam.....ix.netcom.com
=== Fast Forward Engineering - Vista, California
=== http://www.geocities.com/SiliconValley/2499

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