Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > sci.electronics.design > #380478

Re: OT: programming problem

From piglet <erichpwagner@hotmail.com>
Newsgroups sci.electronics.design
Subject Re: OT: programming problem
Date 2015-10-06 09:48 +0100
Organization A noiseless patient Spider
Message-ID <mv01og$cr7$1@dont-email.me> (permalink)
References <dAJQx.52004$P21.14655@fx09.iad>

Show all headers | View raw


On 06/10/2015 07:09, Robert Baer wrote:

>          MOVF    sSTATUS,STATUS  ;assy: d=1;sSTATUS@25 == save STATUS
 > ....
>          MOVF    STATUS,sSTATUS  ;assy: d=0;STATUS@03  == restore STATUS
>          RETURN
>    Using this shows that W is NOT restored, that it set to the delay value.

You cannot do register to (different) register moves. MOVF will either 
move specified file register to W or to itself (the utility of which is 
that it updates flags, e.g. for a Z flag test later on).

When you wrote movf sSTATUS,STATUS the compiler saw the second parameter 
(STATUS) is non-zero and so set direction d=1 when coding.

So in your example above do this to save status word:

movf STATUS,W
movwf sSTATUS
...
...
movf sSTATUS,W
movwf STATUS

It is all in the chip datasheet.

piglet

Back to sci.electronics.design | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

OT: programming problem Robert Baer <robertbaer@localnet.com> - 2015-10-05 23:09 -0700
  Re: OT: programming problem piglet <erichpwagner@hotmail.com> - 2015-10-06 09:48 +0100
    Re: OT: programming problem Robert Baer <robertbaer@localnet.com> - 2015-10-06 09:58 -0700
  Re: OT: programming problem Martin Brown <|||newspam|||@nezumi.demon.co.uk> - 2015-10-06 10:51 +0100
    Re: OT: programming problem Robert Baer <robertbaer@localnet.com> - 2015-10-06 10:11 -0700
      Re: OT: programming problem Robert Baer <robertbaer@localnet.com> - 2015-10-06 13:40 -0700
        Re: OT: programming problem Martin Brown <|||newspam|||@nezumi.demon.co.uk> - 2015-10-07 09:14 +0100
          Re: OT: programming problem Robert Baer <robertbaer@localnet.com> - 2015-10-07 19:50 -0700
  Re: OT: programming problem "P E Schoen" <paul@pstech-inc.com> - 2015-10-06 21:01 -0400
    Re: OT: programming problem Martin Brown <|||newspam|||@nezumi.demon.co.uk> - 2015-10-07 09:16 +0100
      Re: OT: programming problem Lasse Langwadt Christensen <langwadt@fonz.dk> - 2015-10-07 02:00 -0700
        Re: OT: programming problem, NASTY Robert Baer <robertbaer@localnet.com> - 2015-10-07 22:23 -0700
          Re: OT: programming problem, NASTY Martin Brown <|||newspam|||@nezumi.demon.co.uk> - 2015-10-08 12:05 +0100
          Re: OT: programming problem, NASTY piglet <erichpwagner@hotmail.com> - 2015-10-08 16:31 +0100
      Re: OT: programming problem Robert Baer <robertbaer@localnet.com> - 2015-10-07 20:10 -0700
        Re: OT: programming problem new_ibm <randy.day@sasktel.netx> - 2015-10-08 08:33 -0600
    Re: OT: programming problem Robert Baer <robertbaer@localnet.com> - 2015-10-07 19:33 -0700

csiph-web