Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to set a second bit of the register ?

Status
Not open for further replies.

littlefield

Junior Member level 3
Joined
Jul 7, 2007
Messages
27
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,472
A small computer has an 8 bit CPU and only one register.
XOR - is the only assembly command it understands.
How to set a second bit of the register ?
The initial state of the register is unknown.
 

Hi.

I did not clearly understand your question. As far as i understood, u can write a value to the register if you know the address of that register.

If the initial value of the register is '0' u can use the instr

XOR BIT, '1';

Hope it helps.

Thanks
 

do you need to keep other bits same as their original value? Or it is OK to clear them to 0?
 

You can do this by using the following two steps:

XOR BIT, BIT; --> will reset the bit
XOR BIT, '1'; --> will set the bit

Hope this works!!

Regards
Ganesh S
 

if u want to have the other bits unchanged it is imposible. u need at least to register to do this. but the other bits is not important for u do like this:
(a is your register)
a= a xor a
a = a xor 04h
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top