[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]

Отправлено Леонид Иванович 29 мая 2002 г. 11:29
В ответ на: ранее в конфе всплывал такой алгоритм ... отправлено d!ma_bo 29 мая 2002 г. 11:21

;Buff[0..3] convert to BCD Dig[3..9]

notst: ldi ZL,Dig+10
clr temp
clrout: st -Z,temp
cpi ZL,Dig+3
brne clrout ;output array clear

ldi tempD,24 ;input bits count

hloop: lsl tempL ;input array shift left
rol tempM
rol tempH
ldi YL,Dig+10
sloop: ld temp,-Y
rol temp
subi temp,-0x06 ;temp+6, C=1
sbrs temp,4
subi temp,0x06 ;temp-6, C=0
andi temp,0x0f
st Y,temp
cpse YL,ZL ;ZL = Dig+3
rjmp sloop
dec tempD ;YL = Dig+3
brne hloop

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

Ответы



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

E-mail: info@telesys.ru