Hi, I'm trying to assemble the BREQ - Branch if equal - instruction
and I can not understand the logic very well.
The Microchip Studio shows a strange behavior, let me first attach
the AVR instruction description and syntax (taken from the Atmel
AVR instruction set manual).
According to the description, the instruction takes an operand that
can be negative or positive. However, the assembler says that the
"Relative branch is out of reach" when the operand is negative,
as shown below:
Furthermore, positive offsets can go beyond this limit:
The program only has 5 instructions and it doesn't include any file.
Why is BREQ 66 valid?
All offsets between 0 and 66 are valid. If another NOP instruction
was added before BREQ, then the offset 67 would be valid.
This is the generated .hex file:
Cheers.