[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [avr-gcc-list] rjmp confusion
From: |
Dave Hansen |
Subject: |
RE: [avr-gcc-list] rjmp confusion |
Date: |
Wed, 11 Feb 2004 15:02:00 -0500 |
From: Simon Han <address@hidden>
[...]
Based on AVR instruction set documentation, rjmp is defined to be
"relative jump to an address within PC - 2K + 1 and PC + 2K (words)". Then
it says that "for AVR microcontrollers with Program memory not exceeding 4K
words this instruction can address the entire memory from EVERY address
location". I capitalize the word I am confused about. How can a rjmp
instruction located at flash memory 3.5K jump back to flash memory location
at 0.5K? This will require rjmp (-3K).
Remember that program memory is measured in bytes, but addressed (in the PC)
as words. Therefore, an rjmp at "memory 3.5k" (assume 3584) will be at
address 1792, the destination "0.5k" (512) will be ad at address 256, and
the rjump will be -1.5k.
HTH,
-=Dave
_________________________________________________________________
Choose now from 4 levels of MSN Hotmail Extra Storage - no more account
overload! http://click.atdmt.com/AVE/go/onm00200362ave/direct/01/