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

📄 main.lis

📁 使用8880实现DTMF通信及拨号的程序.
💻 LIS
字号:
                        .module main.c
                        .area text(rom, con, rel)
 0000                   .dbfile E:\Shuaihu\AVR\8880\main.c
 0000                   .dbfunc e delay _delay fV
 0000           ;              x -> R16,R17
                        .even
 0000           _delay::
 0000                   .dbline -1
 0000                   .dbline 14
 0000           ; //ICC-AVR application builder : 2007-10-27 10:16:42
 0000           ; // Target : M8
 0000           ; // Crystal: 7.3728Mhz
 0000           ; 
 0000           ; #include <iom8v.h>
 0000           ; #include <macros.h>
 0000           ; #include "8880.h"
 0000           ; #include "serial.h"
 0000           ; #include "main.h"
 0000           ; #include "shell.h"
 0000           ; #include "timer.h"
 0000           ; SysOption sysoption;
 0000           ; void delay(unsigned int x)
 0000           ; {
 0000                   .dbline 15
 0000           ;  for (;x>0;x--);
 0000 02C0              rjmp L5
 0002           L2:
 0002                   .dbline 15
 0002           L3:
 0002                   .dbline 15
 0002 0150              subi R16,1
 0004 1040              sbci R17,0
 0006           L5:
 0006                   .dbline 15
 0006 0030              cpi R16,0
 0008 0107              cpc R16,R17
 000A D9F7              brne L2
 000C           X0:
 000C                   .dbline -2
 000C           L1:
 000C                   .dbline 0 ; func end
 000C 0895              ret
 000E                   .dbsym r x 16 i
 000E                   .dbend
 000E                   .dbfunc e port_init _port_init fV
                        .even
 000E           _port_init::
 000E                   .dbline -1
 000E                   .dbline 19
 000E           ; 
 000E           ; }
 000E           ; void port_init(void)
 000E           ; {
 000E                   .dbline 20
 000E           ;  PORTB = 0x20;  //00010000
 000E 80E2              ldi R24,32
 0010 88BB              out 0x18,R24
 0012                   .dbline 21
 0012           ;  DDRB  = 0x0F;  //00001111
 0012 8FE0              ldi R24,15
 0014 87BB              out 0x17,R24
 0016                   .dbline 22
 0016           ;  PORTC = 0x0F;  //00001111
 0016 85BB              out 0x15,R24
 0018                   .dbline 23
 0018           ;  DDRC  = 0x2F;  //00100000
 0018 8FE2              ldi R24,47
 001A 84BB              out 0x14,R24
 001C                   .dbline 24
 001C           ;  PORTD = 0x0e;  //00000100
 001C 8EE0              ldi R24,14
 001E 82BB              out 0x12,R24
 0020                   .dbline 25
 0020           ;  DDRD  = 0x02;  //00000010
 0020 82E0              ldi R24,2
 0022 81BB              out 0x11,R24
 0024                   .dbline -2
 0024           L6:
 0024                   .dbline 0 ; func end
 0024 0895              ret
 0026                   .dbend
 0026                   .dbfunc e init_devices _init_devices fV
                        .even
 0026           _init_devices::
 0026                   .dbline -1
 0026                   .dbline 30
 0026           ; }
 0026           ; 
 0026           ; //call this routine to initialize all peripherals
 0026           ; void init_devices(void)
 0026           ; {
 0026                   .dbline 32
 0026           ;  //stop errant interrupts until set up
 0026           ;  CLI(); //disable all interrupts
 0026 F894              cli
 0028                   .dbline 33
 0028           ;  port_init();
 0028 F2DF              rcall _port_init
 002A                   .dbline 34
 002A           ;  uart0_init();
 002A 00D0              rcall _uart0_init
 002C                   .dbline 35
 002C           ;  MCUCR = 0x08;
 002C 88E0              ldi R24,8
 002E 85BF              out 0x35,R24
 0030                   .dbline 36
 0030           ;  GICR  = 0x80;
 0030 80E8              ldi R24,128
 0032 8BBF              out 0x3b,R24
 0034                   .dbline 37
 0034           ;  TIMSK = 0x00; //timer interrupt sources
 0034 2224              clr R2
 0036 29BE              out 0x39,R2
 0038                   .dbline 38
 0038           ;  timer1_init();
 0038 00D0              rcall _timer1_init
 003A                   .dbline 39
 003A           ;  SEI(); //re-enable interrupts
 003A 7894              sei
 003C                   .dbline -2
 003C           L7:
 003C                   .dbline 0 ; func end
 003C 0895              ret
 003E                   .dbend
 003E                   .dbfunc e main _main fV
 003E           ;            buf -> y+0
                        .even
 003E           _main::
 003E 6497              sbiw R28,20
 0040                   .dbline -1
 0040                   .dbline 43
 0040           ;  //all peripherals are now initialized
 0040           ; }
 0040           ; void main(void)
 0040           ; {
 0040                   .dbline 45
 0040           ;  char buf[20];
 0040           ;   init_devices();
 0040 F2DF              rcall _init_devices
 0042                   .dbline 46
 0042           ;  M8880_Init();
 0042 00D0              rcall _M8880_Init
 0044                   .dbline 47
 0044           ;  sysoption.echo=-1;
 0044 8FEF              ldi R24,255
 0046 80930000          sts _sysoption,R24
 004A                   .dbline 48
 004A           ;  sysoption.calling=0;
 004A 2224              clr R2
 004C 20920100          sts _sysoption+1,R2
 0050                   .dbline 49
 0050           ;  sysoption.timer=0;
 0050 20920300          sts _sysoption+3,R2
 0054                   .dbline 50
 0054           ;  sysoption.autoanswer=0;
 0054 20920400          sts _sysoption+4,R2
 0058 01C0              rjmp L13
 005A           L12:
 005A                   .dbline 51
 005A           ;  while(1)shellin();
 005A 00D0              rcall _shellin
 005C           L13:
 005C                   .dbline 51
 005C FECF              rjmp L12
 005E           X1:
 005E                   .dbline -2
 005E           L8:
 005E                   .dbline 0 ; func end
 005E 6496              adiw R28,20
 0060 0895              ret
 0062                   .dbsym l buf 0 A[20:20]c
 0062                   .dbend
                        .area bss(ram, con, rel)
 0000                   .dbfile E:\Shuaihu\AVR\8880\main.c
 0000           _sysoption::
 0000                   .blkb 5
 0005                   .dbstruct 0 5 tagsysoption
 0005                   .dbfield 0 echo c
 0005                   .dbfield 1 calling c
 0005                   .dbfield 2 diaing c
 0005                   .dbfield 3 timer c
 0005                   .dbfield 4 autoanswer c
 0005                   .dbend
 0005                   .dbsym e sysoption _sysoption S[tagsysoption]
 0005           ; }

⌨️ 快捷键说明

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