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

📄 ceshi.lst

📁 一个关于AVR单片机的例程
💻 LST
字号:
__start:
__text_start:
    002A E5CF      LDI	R28,0x5F
    002B E0D8      LDI	R29,0x8
    002C BFCD      OUT	0x3D,R28
    002D BFDE      OUT	0x3E,R29
    002E 51C0      SUBI	R28,0x10
    002F 40D0      SBCI	R29,0
    0030 EA0A      LDI	R16,0xAA
    0031 8308      STD	Y+0,R16
    0032 2400      CLR	R0
    0033 E6E0      LDI	R30,0x60
    0034 E0F0      LDI	R31,0
    0035 E010      LDI	R17,0
    0036 36E0      CPI	R30,0x60
    0037 07F1      CPC	R31,R17
    0038 F011      BEQ	0x003B
    0039 9201      ST	R0,Z+
    003A CFFB      RJMP	0x0036
    003B 8300      STD	Z+0,R16
    003C E5E4      LDI	R30,0x54
    003D E0F0      LDI	R31,0
    003E E6A0      LDI	R26,0x60
    003F E0B0      LDI	R27,0
    0040 E010      LDI	R17,0
    0041 35E4      CPI	R30,0x54
    0042 07F1      CPC	R31,R17
    0043 F021      BEQ	0x0048
    0044 95C8      LPM
    0045 9631      ADIW	R30,1
    0046 920D      ST	R0,X+
    0047 CFF9      RJMP	0x0041
    0048 940E005E  CALL	_main
_exit:
    004A CFFF      RJMP	_exit
FILE: D:\AVR与虚拟仪器光盘\教程与范例代码\LED应用\跑马灯\sesh.c
(0001) //ICC-AVR application builder : 2007-5-13 15:07:31
(0002) // Target : M32
(0003) // Crystal: 7.3728Mhz
(0004) 
(0005) #include <iom32v.h>
(0006) #include <macros.h>
(0007) 
(0008) void port_init(void)
(0009) {
(0010)  PORTA = 0x00;
_port_init:
    004B 2422      CLR	R2
    004C BA2B      OUT	0x1B,R2
(0011)  DDRA  = 0x00;
    004D BA2A      OUT	0x1A,R2
(0012)  PORTB = 0x00;
    004E BA28      OUT	0x18,R2
(0013)  DDRB  = 0xff;
    004F EF8F      LDI	R24,0xFF
    0050 BB87      OUT	0x17,R24
(0014)  PORTC = 0x00; 
    0051 BA25      OUT	0x15,R2
(0015)  DDRC  = 0x00;
    0052 BA24      OUT	0x14,R2
(0016)  PORTD = 0x00;
    0053 BA22      OUT	0x12,R2
(0017)  DDRD  = 0x00;
    0054 BA21      OUT	0x11,R2
    0055 9508      RET
(0018) }
(0019) 
(0020) //call this routine to initialize all peripherals
(0021) void init_devices(void)
(0022) {
(0023)  //stop errant interrupts until set up
(0024)  CLI(); //disable all interrupts
_init_devices:
    0056 94F8      BCLR	7
(0025)  port_init();
    0057 DFF3      RCALL	_port_init
(0026) 
(0027)  MCUCR = 0x00;
    0058 2422      CLR	R2
    0059 BE25      OUT	0x35,R2
(0028)  GICR  = 0x00;
    005A BE2B      OUT	0x3B,R2
(0029)  TIMSK = 0x00; //timer interrupt sources
    005B BE29      OUT	0x39,R2
(0030)  SEI(); //re-enable interrupts
    005C 9478      BSET	7
    005D 9508      RET
(0031)  //all peripherals are now initialized
(0032) }
(0033) 
(0034) void main(void)
(0035) {
(0036) init_devices();
_main:
    005E DFF7      RCALL	_init_devices
    005F C001      RJMP	0x0061
(0037) while(1)
(0038) {
(0039) PORTB|=0x01;
FILE: <library>
    0060 9AC0      SBI	0x18,0
    0061 CFFE      RJMP	0x0060
    0062 9508      RET

⌨️ 快捷键说明

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