Need help in AT89C51 !!

Thread Starter

lesin akbar

Joined Dec 16, 2007
30
i want to assign a label for a bit address, what to do?
i shall make my question more specific. i wnt to move 90.7 address( which is p1.7 in SFR) to some label for example "chk", so that i can check "chk" whether it is high or low instead of the real p1.7. I hope it is clear.

this is bcoz i've wrote a sub function for a particular task and it will keep on verifying the "chk" label. But the pin it is actually checking may be different for different condition. If i take the other way i'll have to write a plenty of same functions. What to do ????? Plz.........
 

Papabravo

Joined Feb 24, 2006
21,225
You dont say if you are doing this in assembly language or in some high level language. The basic hardware allows you to move bits in the RAM (locations 0x20 through 0x2F) and the SFR space {0x80, 0x88,..,0xF0, 0xF8} to and from the Carry bit in the PSW. The carry bit is like a 1-bit accumulator. A rotate instruction which includes the Carry bit will move the value of the carry bit into the LSB of the Accumulator (ACC) so you can move it to a register, internal RAM, or external RAM.

Does that help?
 

Thread Starter

lesin akbar

Joined Dec 16, 2007
30
NO, i had to change my logic, i think the question i proposed is not possible.
But i gained from ur reply, that was a very nice thing , hope i can use it in future, thank u , thank u very much.
 
Top