What does CLEAR actually clear?


Closed Thread
Results 1 to 4 of 4
  1. #1

    Default What does CLEAR actually clear?

    Assume I have
    A VAR BYTE
    B VAR BYTE
    PortD = %11111111
    [some code here]
    CLEAR
    [rest of code]

    Help for CLEAR says "Set all RAM registers to zero. CLEAR zeroes all the RAM registers in each bank. This will set all variables, including the internal system variables to zero....

    A and B will be cleared to 0 but what happens to PortD? Will it also be cleared to %00000000 or will it remain at %11111111?

    I can't get to a PIC right now to try this unfortunately so I'm hoping someone knows the answer.

    Cheers
    Brian

  2. #2
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    CLEAR just clears all variables in RAM to 0. It doesn't affect ports. And when you declare something like MyVar VAR PORTD, this doesn't create a variable in RAM. It just creates an alias you can use VS using PORTD.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  3. #3
    Join Date
    Aug 2014
    Posts
    2


    Did you find this post helpful? Yes | No

    Default Re: What does CLEAR actually clear?

    it just clears variables for example it doesnt clear t1con

  4. #4
    Join Date
    May 2013
    Location
    australia
    Posts
    2,379


    Did you find this post helpful? Yes | No

    Default Re: What does CLEAR actually clear?

    are you actually asking a question or are you trying to answer threads that have been dormant for several years

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts