# How to Address Variables

How do we address things? How do I copy the word stored at var1 to D0? It's very simple, just move.w (var1),d0. As usual, the upper 16 bits are unaffected. How do we make A0 point at str1? Also easy. Just use lea str1(PC),a0. You MUST type (PC) after the label, otherwise it will not work! This is just the way we get the address of a label (see Effective Addressing) After loading A0 with the pointer to str1, you can get the first byte with move.b (a0)+,d0 This copies the first byte ('H' = 72) to D0 and increases A0 with one, thus pointing to the next character. Here you must use parentheses since else it would mean copy A0, not the byte stored at A0, to D0.

####