Low and high bytes

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am still trying to convert my IAR project (mixed C and assembly) to GCC. People have said RTFM, but I can't find what I need.

I want to reference an array in assembly. So I put the low byte of the address in r28 and the high byte in r29.

ldi r28,low(Analog)
ldi r29,high(Analog)

But it does not like "low" and "high". It says "garbage at end of line." How do I get the low and high bytes?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I found it! It should be:

ldi r28,lo8(Analog)
ldi r29,hi8(Analog)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

I found it!

Maybe it was this page of the manual - if not then this is probably worth a look:

http://sourceware.org/binutils/d...