Relative jump to an address within PC - 2K +1 and PC + 2K (words). In the assembler, labels are used instead of relative operands. For AVR microcontrollers with program memory not exceeding 4K words (8K bytes) this instruction can address the entire memory from every address location.
Based on http://www.atmel.com/webdoc/avrassembler/avrassembler.wb_RJMP.html , the rjmp
command should change the PC register relatively. But my code below are jumping to the exact address (in this case to ldi temp, low(RAMEND)
command with address 0x00)
.include "m8515def.inc"
.def temp = r16
STACK_INIT:
; init stack pointer
ldi temp, low(RAMEND)
out SPL, temp
ldi temp, high(RAMEND)
out SPH, temp
TES:
rjmp 0x00
END:
rjmp END
I've tried to change the rjmp
command to jmp
but the atmega8515 doesn't support that command
I don't know if this because of the configuration or something. I'm using AVR Studio 4 for build and run my program. Can anybody explain about it?