⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tools.s

📁 AVR单片机,STK500下载线制作全套资料,包括程序,电路图
💻 S
字号:
	.module tools.c
	.area vector(rom, abs)
	.org 12
	rjmp _T1_OCR1A
	.area text(rom, con, rel)
	.dbfile E:\ICCAVR\project\AVRISP~1\icc\tools.c
	.dbfunc e T1_OCR1A _T1_OCR1A fV
	.even
_T1_OCR1A::
	st -y,R24
	st -y,R25
	in R24,0x3f
	st -y,R24
	.dbline -1
	.dbline 18
; 
; #include "stk500.h"
; 
; static unsigned int t1_tick;
; 
; //Konstanten im EEPROM
; //#define EEPROM  __attribute__ ((section (".eeprom")))
; 
; //Variablen im EEPROM
; //EEPROM unsigned char eeprom_sck_period=10;
; //unsigned char eeprom_sck_period=10;
; 
; #ifndef __iom88v_h
; #pragma interrupt_handler T1_OCR1A: 7	/*meag8*/
; #else
; #pragma interrupt_handler T1_OCR1A: 12	/*mega88*/
; #endif
; void T1_OCR1A(void) {
	.dbline 19
; 	t1_tick --;
	lds R24,_t1_tick
	lds R25,_t1_tick+1
	sbiw R24,1
	sts _t1_tick+1,R25
	sts _t1_tick,R24
	.dbline -2
L2:
	ld R24,y+
	out 0x3f,R24
	ld R25,y+
	ld R24,y+
	.dbline 0 ; func end
	reti
	.dbend
	.dbfunc e get_t1_tick _get_t1_tick fc
	.even
_get_t1_tick::
	.dbline -1
	.dbline 33
; }
; 
; /*延时函数*/
; //void wait_ms(unsigned int n) {
; //
; //	unsigned int a, b;
; //	for (a = 0; a < n; a++) {
; //		for (b = 600; b; b--) {
; //			;
; //			}
; //		}
; //}
; 
; unsigned char get_t1_tick(void) {
	.dbline 34
; 	if(t1_tick) {
	lds R2,_t1_tick
	lds R3,_t1_tick+1
	tst R2
	brne X0
	tst R3
	breq L4
X0:
	.dbline 34
	.dbline 35
; 		t1_tick=0;
	clr R2
	clr R3
	sts _t1_tick+1,R3
	sts _t1_tick,R2
	.dbline 36
; 		return 1;
	ldi R16,1
	rjmp 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::
	rcall push_gset1
	movw R20,R16
	.dbline -1
	.dbline 41
; }
; 
; void wait_ms(unsigned int n) {
	rjmp L8
L7:
	.dbline 42
; 	while(n) {
	.dbline 43
; 		if (get_t1_tick()) {
	rcall _get_t1_tick
	tst R16
	breq L10
	.dbline 43
	.dbline 44
; 			n --;
	subi R20,1
	sbci R21,0
	.dbline 45
; 			}
L10:
	.dbline 46
L8:
	.dbline 42
	cpi R20,0
	cpc R20,R21
	brne L7
X1:
	.dbline -2
L6:
	rcall pop_gset1
	.dbline 0 ; func end
	ret
	.dbsym r n 20 i
	.dbend
	.area bss(ram, con, rel)
	.dbfile E:\ICCAVR\project\AVRISP~1\icc\tools.c
_t1_tick:
	.blkb 2
	.dbsym s t1_tick _t1_tick i

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -