📄 tools.s
字号:
.module tools.c
.area text(rom, con, rel)
.dbfile E:\单片机\源程序\Snail_mkII\STK500_V2\ICC\tools.c
.area eeprom(rom, con, rel)
.dbfile E:\单片机\源程序\Snail_mkII\STK500_V2\ICC\tools.c
_eeprom_sck_period::
.byte 10
.area data(ram, con, rel)
.dbfile E:\单片机\源程序\Snail_mkII\STK500_V2\ICC\tools.c
.area vector(rom, abs)
.org 28
jmp _Timer1_COMPA_ISR
.area data(ram, con, rel)
.dbfile E:\单片机\源程序\Snail_mkII\STK500_V2\ICC\tools.c
.area text(rom, con, rel)
.dbfile E:\单片机\源程序\Snail_mkII\STK500_V2\ICC\tools.c
.dbfunc e Timer1_COMPA_ISR _Timer1_COMPA_ISR fV
.even
_Timer1_COMPA_ISR::
st -y,R24
st -y,R25
in R24,0x3f
st -y,R24
.dbline -1
.dbline 26
; /** \file
; <b>some tools</b><br>
; Autor: Matthias Wei遝r<br>
; Copyright 2005: Matthias Wei遝r<br>
; License: QPL (see license.txt)
; <hr>
; */
; #include <iccioavr.h>
; #include <eeprom.h>
;
; #include "tools.h"
;
; volatile unsigned char t1_tick;
; unsigned char t1_cnt;
;
; //Konstanten im EEPROM
; //#define EEPROM __attribute__ ((section (".eeprom")))
;
; //Variablen im EEPROM
; #pragma data:eeprom
; unsigned char eeprom_sck_period = 10;
; #pragma data:data
;
; #pragma interrupt_handler Timer1_COMPA_ISR:iv_TIMER1_COMPA
; void Timer1_COMPA_ISR(void)
; {
.dbline 27
; t1_tick=1;
ldi R24,1
sts _t1_tick,R24
.dbline 28
; t1_cnt++;
lds R24,_t1_cnt
subi R24,255 ; addi 1
sts _t1_cnt,R24
.dbline -2
L2:
.dbline 0 ; func end
ld R24,y+
out 0x3f,R24
ld R25,y+
ld R24,y+
reti
.dbend
.dbfunc e get_t1_tick _get_t1_tick fc
.even
_get_t1_tick::
.dbline -1
.dbline 32
; }
;
; unsigned char get_t1_tick(void)
; {
.dbline 33
; if (t1_tick)
lds R2,_t1_tick
tst R2
breq L4
X0:
.dbline 34
; {
.dbline 35
; t1_tick=0;
clr R2
sts _t1_tick,R2
.dbline 36
; return 1;
ldi R16,1
xjmp L3
L4:
.dbline 38
; }
; return 0;
clr R16
.dbline -2
L3:
.dbline 0 ; func end
ret
.dbend
.dbfunc e wait_ms _wait_ms fV
; n -> R20,R21
.even
_wait_ms::
st -y,R20
st -y,R21
movw R20,R16
.dbline -1
.dbline 45
; }
;
; /**
; Wartet n*1ms - 1ms max.
; */
; void wait_ms(unsigned int n)
; {
xjmp L8
L7:
.dbline 47
; while (n)
; {
.dbline 48
; if (get_t1_tick()) n--;
xcall _get_t1_tick
tst R16
breq L10
X1:
.dbline 48
subi R20,1
sbci R21,0
L10:
.dbline 49
; }
L8:
.dbline 46
cpi R20,0
cpc R20,R21
brne L7
X2:
.dbline -2
L6:
.dbline 0 ; func end
ld R21,y+
ld R20,y+
ret
.dbsym r n 20 i
.dbend
.area bss(ram, con, rel)
.dbfile E:\单片机\源程序\Snail_mkII\STK500_V2\ICC\tools.c
_t1_cnt::
.blkb 1
.dbsym e t1_cnt _t1_cnt c
_t1_tick::
.blkb 1
.dbsym e t1_tick _t1_tick c
; }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -