Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8796101
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:32:44+00:00 2026-06-13T23:32:44+00:00

Is there a difference in assigning a whole byte to an SFR or applying

  • 0

Is there a difference in assigning a whole byte to an SFR or applying an AND or OR to it’s value?

In other words, does it matter if I set some bits to same value as they were previously or this can trigger some hardware reaction?

For example I start from:

MOV UARTCON, 0x9b

Then with the same final value I can do

ORL UARTCON, 0x40

or

MOV UARTCON, 0xdb

or even

SETB UARTCON.6

Is there any difference?

I’m not talking particularly about UARTCON here, but about general mechanism of SFRs. Is the set of a bit matters or only the change of that bit?

UPD I can narrow the question: are bit addressable SFRs altered internally by bits or as a whole bytes even with instructions like CLR, SETB, ORL and AND?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T23:32:45+00:00Added an answer on June 13, 2026 at 11:32 pm

    There may be some bits that have different meaning when read and written, such as the port pins. When written they set the latch and the output, when read they return the input. To configure a pin for input, you write a 1 to it. Suppose you have set P1.0 to input and it is externally pulled low, that is it will be read as 0. Now if you want to set P1.1 to input as well, you can do SETB P1.1 and that will work fine. However if you read the value of P1, modify the value, then write it back, then it won’t work:

    MOV P1, #1 ; set P1.0 to input
    MOV A, P1  ; reads 0
    ORL A, #2
    MOV P1, A  ; P1.0 no longer input
    

    Note that ORL P1, #2, while it logically does the same, works because the processor has special support and knows to read the port latch instead of the pin input.

    Another possibility you mentioned was the write triggering something. One such example is SBUF. Even if you write the same value there, it will trigger a transmission. However this isn’t really relevant to your question, since it’s not bit-addressable. In the context of standard 8051 I can’t think of another SFR that exhibits similar behavior.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In python, is there a difference between calling clear() and assigning {} to a
Is there difference in behavior between a constructor call and a procedure call in
Is there any difference (compiler/interpreter/juju wise, etc) between the two versions of checking the
Is there any difference between ReferencePath with condition '%(CopyLocal)'=='true' and ReferenceCopyLocalPaths ? The question
Is there a difference between this.form and document.forms (document[forms]) or, are they similar? Here
Is there any difference between: public ActionResult logOff() { FormsAuth.SignOut(); return RedirectToAction(index, Home); }
Is there any difference between '{' and '[' when formatting a JSON object?
is there a difference between: mvt_act_idx = openCloseList.size()-1; openCloseList[mvt_act_idx].A += a; and openCloseList.back().A +=
Is there any difference between the below 2 CREATE TABLE statements in SQL Server
Is there any difference between doing this: $(.topHorzNavLink).click(function() { var theHoverContainer = $(#hoverContainer); var

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.