Need help in AT89C51 !!

Discussion in 'Programmer's Corner' started by lesin akbar, Jan 7, 2008.

  1. lesin akbar

    Thread Starter Active Member

    Dec 16, 2007
    30
    0
    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.........
     
  2. Papabravo

    Expert

    Feb 24, 2006
    10,148
    1,791
    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?
     
  3. lesin akbar

    Thread Starter Active Member

    Dec 16, 2007
    30
    0
    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.
     
Loading...