Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

HC12 question

  1. Mar 2, 2007 #1
    I cannot understand why the following bits are equivalent:

    Code (Text):

    LDAA 0,X
    INCX
    ;and
    LDAA 1,X+

    The 1 is throwing me off. Since the X register is post incremented, why is it necessary? I would think that LDAA 0,X+ would be equivalent to the first bit of code. What am I missing?
     
  2. jcsd
  3. Mar 2, 2007 #2

    berkeman

    User Avatar

    Staff: Mentor

    I don't program in HC 12 assembly, but is the first arguent to the LDAA instruction the register number?
     
  4. Mar 4, 2007 #3
    Right, I was thinking that might be a problem.

    LDAA 0,X loads the A accumulator with the address stored in the X register, plus the offset (0, in this case).

    LDAA 1,X+ loads the A accumulator with the address in the X register, plus the offset (1 in this case), and then increments the X register.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?



Similar Discussions: HC12 question
  1. Resistance Question (Replies: 2)

  2. Wiring Question (Replies: 1)

  3. Charges question (Replies: 1)

  4. Amplifiers question (Replies: 2)

Loading...