[an error occurred while processing this directive]
Ответ: Относительно regvar
(«Телесистемы»: Конференция «Микроконтроллеры и их применение»)

миниатюрный аудио-видеорекордер mAVR

Отправлено Bill 18 сентября 2002 г. 18:01
В ответ на: Ответ: Дык здесь help какой-то дурацкий отправлено superkeks 18 сентября 2002 г. 17:38



PLACING DATA IN REGISTERS
The __regvar keyword is used for declaring that a global or static
variable should be placed permanently in the specified register or
registers. The registers R4 –R15 can be used for this purpose, provided that they have been locked with the --lock_regs compiler option; see
page 102 for additional information. Also see Register usage, page 43.
To declare a global register variable, use the following syntax:
__regvar __no_init type_name variable_name @location
This will create a variable called variable_name of type type_name ,
located in registers starting from R location , e.g.
__regvar __no_init int counter @14;
This will create the 16-bit integer variable counter, which will always be available in R15:R14 . At least two registers must be locked. And, as noted on page 103, if you lock any registers in your code, the library must be rebuilt with the same set of locked registers.
Note: It is not possible to point to an object that has been declared
__regvar . An object declared __regvar cannot have an initial value.

Относительно asm

Inline assembler
The asm intrinsic function assembles and inserts the supplied assembler
statement in-line. The statement can include instruction mnemonics,
register mnemonics, constants, and/or a reference to a global variable. For example:
asm("LDI R16,0 \n LDI R17,0 \n RET");


Составить ответ  |||  Конференция  |||  Архив

Ответы



Перейти к списку ответов  |||  Конференция  |||  Архив  |||  Главная страница  |||  Содержание  |||  Без кадра

E-mail: info@telesys.ru