=GM= Цитата
Не совсем так. "Функциональность" НЕ "покрывается полностью командой rjmp", поскольку команда относительного перехода работает в пределах +-2Кслова, но в атмеге8 имеется 4Кслова памяти, так что для перехода, скажем, из конца памяти в ее начало потребуется два rjmp, а не один.
Запускаем AVRStudio (4.12.498, у старых тоже должно быть),
отрываем Help-AVR Studio User Guide-Поиск.
Ищем слово wrap.
Находим Assembly project.
Читаем раздел:
Цитата
Wrap relative jumps
The AVR RJMP/RCALL instructions allow a 12-bit PC-relative offset, corresponding to +/-2k words. For devices with 4k words (8k bytes) or less FLASH program memory, the Wrap option causes the assembler's offset calculation to wrap around over the addressable program memory range, enabling the entire program memory to be addressed using these instructions.
For devices with more than 4k words of program memory, using this option may cause unpredictable results and it should be turned off.
If it is left on, the assembler will produce a warning when wrap takes effect:
warning: Wrap rjmp/rcall illegal for device > 4k words - Turn off wrap option and use jmp/call
This diagnostic is given as a warning and not an error to retain compatibility with earlier versions of the assembler, but should be treated as an error by the user. The JMP/CALL 2-word instructions take 22-bit absolute addresses and should be used instead.
То есть, для мега8 ставим галочку в настройках ассемблера:
Project-Assembler Options-Wrap Relative Jumps
и гуляем с помощью rjmp, или rcall по всей флэши.
А если у нас мега16 и выше, то эту галочку надо объязательно убрать.
____________________
Александр
2006 11 21
PS. Вот тут аналогичная тема обсуждалась:
http://www.fulcrum.ru/cgi-bin/bbs/mess_sel...4966&page=1