This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

About SFR

How to define TH2 and TL2 as a int
I tried using data unsigned int Count _at_ 0xCD but it is giving error C274

Parents
  • "How to define TH2 and TL2 as a int"

    What do you mean by that?

    An int in C51 is 16 bits; TH2 and TL2 are each 8 bits, so they can't be ints, can they?

    Or do you mean that you want TH2+TL2 together to be a single int? If so, have you looked at the sfr16 keyword extension?

    "I tried using data unsigned int Count _at_ 0xCD

    That won't work - SFRs aren't in the DATA space, are they?

Reply
  • "How to define TH2 and TL2 as a int"

    What do you mean by that?

    An int in C51 is 16 bits; TH2 and TL2 are each 8 bits, so they can't be ints, can they?

    Or do you mean that you want TH2+TL2 together to be a single int? If so, have you looked at the sfr16 keyword extension?

    "I tried using data unsigned int Count _at_ 0xCD

    That won't work - SFRs aren't in the DATA space, are they?

Children
No data