Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
03/22/07 14:43
Modified:
  03/22/07 16:36

Read: times


 
#135587 - How about using XOR function??
Responding to: ???'s previous message
Mariusz Sobkowiak said:
Is there any simple way to set or clear any bit (from registers 20H..2FH) which address is stored for example in R0 ?

I'm trying to do:
SETB 12H (register 22H bit 2)

But this way :
SETB @R0 , where R0=12H

Of course there is no command SETB @R0.

How to do it for any bit ?


You can take that whole byte (22H) to work on with.
So if you want any bit of 22H (byte) to be set or cleared, you could XOR 8- bit of 22H with an 8- bit data that holds the corresponding bit location that you want to complement on 22H as "high" and all other bits low. This is shown below:
data in 22H:  10101010

So, if i need to complement bit location 2 (12H),

i can do like this;
[Edited]
data in 22H:  10101010
          XOR 00000100  
              --------
              10101110
              --------

Will this work?

regard's
Suresh.








List of 13 messages in thread
TopicAuthorDate
Bit addressing            01/01/70 00:00      
   Example            01/01/70 00:00      
   One way...            01/01/70 00:00      
   what is simple?            01/01/70 00:00      
      OH boy            01/01/70 00:00      
         this is FAR from my notion of self-modifying code.            01/01/70 00:00      
            self modifyeing code - definition            01/01/70 00:00      
               context, context, context...            01/01/70 00:00      
                  where do you see that???            01/01/70 00:00      
                     Coding religion            01/01/70 00:00      
         I think he did RTFM?            01/01/70 00:00      
            you are right, sorry            01/01/70 00:00      
   How about using XOR function??            01/01/70 00:00      

Back to Subject List