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

📄 main.s

📁 使用8880实现DTMF通信及拨号的程序.
💻 S
字号:
	.module main.c
	.area text(rom, con, rel)
	.dbfile E:\Shuaihu\AVR\8880\main.c
	.dbfunc e delay _delay fV
;              x -> R16,R17
	.even
_delay::
	.dbline -1
	.dbline 14
; //ICC-AVR application builder : 2007-10-27 10:16:42
; // Target : M8
; // Crystal: 7.3728Mhz
; 
; #include <iom8v.h>
; #include <macros.h>
; #include "8880.h"
; #include "serial.h"
; #include "main.h"
; #include "shell.h"
; #include "timer.h"
; SysOption sysoption;
; void delay(unsigned int x)
; {
	.dbline 15
;  for (;x>0;x--);
	rjmp L5
L2:
	.dbline 15
L3:
	.dbline 15
	subi R16,1
	sbci R17,0
L5:
	.dbline 15
	cpi R16,0
	cpc R16,R17
	brne L2
X0:
	.dbline -2
L1:
	.dbline 0 ; func end
	ret
	.dbsym r x 16 i
	.dbend
	.dbfunc e port_init _port_init fV
	.even
_port_init::
	.dbline -1
	.dbline 19
; 
; }
; void port_init(void)
; {
	.dbline 20
;  PORTB = 0x20;  //00010000
	ldi R24,32
	out 0x18,R24
	.dbline 21
;  DDRB  = 0x0F;  //00001111
	ldi R24,15
	out 0x17,R24
	.dbline 22
;  PORTC = 0x0F;  //00001111
	out 0x15,R24
	.dbline 23
;  DDRC  = 0x2F;  //00100000
	ldi R24,47
	out 0x14,R24
	.dbline 24
;  PORTD = 0x0e;  //00000100
	ldi R24,14
	out 0x12,R24
	.dbline 25
;  DDRD  = 0x02;  //00000010
	ldi R24,2
	out 0x11,R24
	.dbline -2
L6:
	.dbline 0 ; func end
	ret
	.dbend
	.dbfunc e init_devices _init_devices fV
	.even
_init_devices::
	.dbline -1
	.dbline 30
; }
; 
; //call this routine to initialize all peripherals
; void init_devices(void)
; {
	.dbline 32
;  //stop errant interrupts until set up
;  CLI(); //disable all interrupts
	cli
	.dbline 33
;  port_init();
	rcall _port_init
	.dbline 34
;  uart0_init();
	rcall _uart0_init
	.dbline 35
;  MCUCR = 0x08;
	ldi R24,8
	out 0x35,R24
	.dbline 36
;  GICR  = 0x80;
	ldi R24,128
	out 0x3b,R24
	.dbline 37
;  TIMSK = 0x00; //timer interrupt sources
	clr R2
	out 0x39,R2
	.dbline 38
;  timer1_init();
	rcall _timer1_init
	.dbline 39
;  SEI(); //re-enable interrupts
	sei
	.dbline -2
L7:
	.dbline 0 ; func end
	ret
	.dbend
	.dbfunc e main _main fV
;            buf -> y+0
	.even
_main::
	sbiw R28,20
	.dbline -1
	.dbline 43
;  //all peripherals are now initialized
; }
; void main(void)
; {
	.dbline 45
;  char buf[20];
;   init_devices();
	rcall _init_devices
	.dbline 46
;  M8880_Init();
	rcall _M8880_Init
	.dbline 47
;  sysoption.echo=-1;
	ldi R24,255
	sts _sysoption,R24
	.dbline 48
;  sysoption.calling=0;
	clr R2
	sts _sysoption+1,R2
	.dbline 49
;  sysoption.timer=0;
	sts _sysoption+3,R2
	.dbline 50
;  sysoption.autoanswer=0;
	sts _sysoption+4,R2
	rjmp L13
L12:
	.dbline 51
;  while(1)shellin();
	rcall _shellin
L13:
	.dbline 51
	rjmp L12
X1:
	.dbline -2
L8:
	.dbline 0 ; func end
	adiw R28,20
	ret
	.dbsym l buf 0 A[20:20]c
	.dbend
	.area bss(ram, con, rel)
	.dbfile E:\Shuaihu\AVR\8880\main.c
_sysoption::
	.blkb 5
	.dbstruct 0 5 tagsysoption
	.dbfield 0 echo c
	.dbfield 1 calling c
	.dbfield 2 diaing c
	.dbfield 3 timer c
	.dbfield 4 autoanswer c
	.dbend
	.dbsym e sysoption _sysoption S[tagsysoption]
; }

⌨️ 快捷键说明

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