📄 runtime.s
字号:
.module runtime.c
.text
.dbfile C:\Documents\Software\AVR\lcd16x2\code\runtime.c
.area vector(abs)
.org 56
jmp _RuntimeInterrupt
.area text
.dbfile C:\Documents\Software\AVR\lcd16x2\code\runtime.c
.dbfunc s RuntimeInitialise _RuntimeInitialise fI
.even
_RuntimeInitialise::
.dbline 15{
; /* ATmega103 runtime.c file
;
; Author : Robert Stuart
; Company : PDL Industries
; Date of Creation : 21 July 1999
; Tested : not yet
;
; Function :
; */
;
; /* include */
; #include "runtime.h"
;
; void RuntimeInitialise( void )
; {
.dbline 16
; TCCR1B = 0; /* Stop T1 */
clr R2
out 0x2e,R2
.dbline 17
; TCNT1 = 0; /* Clear T1 */
clr R3
sts 76+1,R3
sts 76,R2
.dbline 18
; OCR1A = _1MS_INTERRUPT; /* Set Compare A - 1ms for a 6MHz clock */
ldi R24,112
ldi R25,23
sts 74+1,R25
sts 74,R24
.dbline 19
; TIMSK = BIT(OCIE1A); /* Compare A interrupt enabled */
ldi R24,16
out 0x37,R24
.dbline 20
; TCCR1B = BIT(CS10) | BIT(CTC1);
ldi R24,9
out 0x2e,R24
.dbline 21}
; }
L1:
ret
.area bss
.dbfile C:\Documents\Software\AVR\lcd16x2\code\runtime.c
L3:
.blkb 2
L4:
.blkb 1
.area text
.dbfile C:\Documents\Software\AVR\lcd16x2\code\runtime.c
.dbfunc s RuntimeInterrupt _RuntimeInterrupt fI
.dbsym s seconds L4 c
.dbsym s delay L3 I
; str -> y+2
.even
_RuntimeInterrupt::
call push_lset
sbiw R28,19
.dbline 24{
;
; void RuntimeInterrupt( void )
; {
.dbline 29
; static int delay;
; static char seconds;
; char str[17];
;
; if ( ++delay == _1000MS )
lds R25,L3+1
lds R24,L3
adiw R24,1
mov R2,R24
mov R3,R25
sts L3+1,R3
sts L3,R2
mov R24,R2
mov R25,R3
cpi R24,232
ldi R24,3
cpc R25,R24
brne L5
.dbline 30
; {
.dbline 31
; if ( ++seconds == 60 )
lds R24,L4
subi R24,255 ; addi 1
mov R2,R24
sts L4,R2
mov R24,R2
cpi R24,60
brne L7
.dbline 32
; seconds = 0;
clr R2
sts L4,R2
L7:
.dbline 33
; sprintf( str, "Seconds %d", seconds);
lds R2,L4
clr R3
std y+0,R2
std y+1,R3
ldi R18,<L9
ldi R19,>L9
mov R24,R28
mov R25,R29
adiw R24,2
mov R16,R24
mov R17,R25
call _sprintf
.dbline 34
; LCDPrintf( str, "ATmega103" );
ldi R18,<L10
ldi R19,>L10
mov R24,R28
mov R25,R29
adiw R24,2
mov R16,R24
mov R17,R25
call _LCDPrintf
.dbline 35
; delay = 0;
clr R2
clr R3
sts L3+1,R3
sts L3,R2
.dbline 36
; }
L5:
.dbline 38
;
; DelayLCDStartup();
call _DelayLCDStartup
.dbline 40
;
; WDR;
WDR
.dbline 41}
; }
L2:
adiw R28,19
call pop_lset
reti
.dbsym l str 2 Ac[17:17]
.area data
.dbfile C:\Documents\Software\AVR\lcd16x2\code\runtime.c
L10:
.blkb 10
.area idata
.byte 'A,'T,'m,'e,'g,'a,49,48,51,0
.area data
.dbfile C:\Documents\Software\AVR\lcd16x2\code\runtime.c
L9:
.blkb 11
.area idata
.byte 'S,'e,'c,'o,'n,'d,'s,32,37,'d,0
.area data
.dbfile C:\Documents\Software\AVR\lcd16x2\code\runtime.c
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -