[an error occurred while processing this directive] [an error occurred while processing this directive]
Можно страшную макру впендрюжить...
(«Телесистемы»: Конференция «Микроконтроллеры и их применение»)
[an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive]

Отправлено Xan 24 октября 2001 г. 15:29
В ответ на: Ответ: отправлено Castle 24 октября 2001 г. 14:09

Что-нить вроде:


Setbit .macro bit
if bit = 0
SBR R16, 0x00000001
endif
if bit = 1
SBR R16, 0x00000010
endif
if bit = 2
SBR R16, 0x00000100
endif
if bit = 3
SBR R16, 0x00001000
endif
if bit = 4
SBR R16, 0x00010000
endif
if bit = 5
SBR R16, 0x00100000
endif
if bit = 6
SBR R16, 0x01000000
endif
if bit = 7
SBR R16, 0x10000000
endif
endm

И тогда на
.equ Flag = 3
когда попадётся
Setbit Flag
асма подставит
SBR R16, 0x0001000


Ok?

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

Ответы



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

E-mail: info@telesys.ru