0

I'm new in assembly language and to have a little practice I'm programming Arduino using only avr assembler and avr_gcc. I was trying to use ST and LD instructions and in every example, that I had found address is loading to X, Y or Z register directly for example:

ldi r30, 0x00
ldi r31, 0x06

But is there (in avr_gcc) any way to put to Z register address of variable? I know that in masm for that purpose was OFFSET directive.

LLDevLab
  • 56
  • 3
  • You can usi `ldi` with `LOW` and `HIGH` like [here](http://www.avr-asm-tutorial.net/avr_en/beginner/REGISTER.html#pointer) and [here](http://www.avrfreaks.net/forum/stdldd-instead-stslds-instructions). – Margaret Bloom May 08 '17 at 19:21
  • Thanks for your reply. LOW and HIGH for some reason doesn't work for me, but I've got an idea how to google it :) . lo8 and hi8 is working. Got an answer from here: http://stackoverflow.com/questions/34368602/avr-gcc-error-garbage-at-end-of-line – LLDevLab May 09 '17 at 18:13

1 Answers1

0

LOW and HIGH doesn't work with avr-gcc. lo8 and hi8 is working instead.

LLDevLab
  • 56
  • 3