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

Literal evaluation messed up

When I write the following in uVision,

mov A, -2000

I want A to contain 0x30, as -2000 is 0xF830. Instead it contains 0x05. Is there any predefined macro to be able to treat a literal as sixteen bits and extract the lower (or upper) eight bits out of it?

Thanks.

Parents
  • mov A, -2000

    what are you trying to do?? it makes no sense to try to cram -2000 into an 8 bit register.

    however, whatever you try to do (which must make sense to you) I suggest you look up HIGH and LOW in the manusl for the solution.

    btw should it not be mov A, #-2000

    Erik

Reply
  • mov A, -2000

    what are you trying to do?? it makes no sense to try to cram -2000 into an 8 bit register.

    however, whatever you try to do (which must make sense to you) I suggest you look up HIGH and LOW in the manusl for the solution.

    btw should it not be mov A, #-2000

    Erik

Children