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

📄 lighten_leds_recurrently.lst

📁 ATmega128单片机开发板原理图
💻 LST
字号:
__text_start:
__start:
      46 EFCF      LDI	R28,0xFF
      47 E1D0      LDI	R29,0x10
      48 BFCD      OUT	0x3D,R28
      49 BFDE      OUT	0x3E,R29
      4A 51CE      SUBI	R28,0x1E
      4B 40D0      SBCI	R29,0
      4C EA0A      LDI	R16,0xAA
      4D 8308      STD	Y+0,R16
      4E 2400      CLR	R0
      4F E0E0      LDI	R30,0
      50 E0F1      LDI	R31,1
      51 E011      LDI	R17,1
      52 30E0      CPI	R30,0
      53 07F1      CPC	R31,R17
      54 F011      BEQ	0x0057
      55 9201      ST	R0,Z+
      56 CFFB      RJMP	0x0052
      57 8300      STD	Z+0,R16
      58 E8EC      LDI	R30,0x8C
      59 E0F0      LDI	R31,0
      5A E0A0      LDI	R26,0
      5B E0B1      LDI	R27,1
      5C E010      LDI	R17,0
      5D E000      LDI	R16,0
      5E BF0B      OUT	0x3B,R16
      5F 38EC      CPI	R30,0x8C
      60 07F1      CPC	R31,R17
      61 F021      BEQ	0x0066
      62 95C8      LPM
      63 9631      ADIW	R30,1
      64 920D      ST	R0,X+
      65 CFF9      RJMP	0x005F
      66 940E 00A0 CALL	_main
_exit:
      68 CFFF      RJMP	_exit
FILE: E:\DOCUME~1\Administrator\桌面\源程序\main.c
(0001) //ICC-AVR application builder : 2008-2-22 9:34:31
(0002) // Target : M128
(0003) // Crystal: 14.7456Mhz
(0004) 
(0005) #include <iom128v.h>
(0006) #include <macros.h>
(0007) 
(0008) void port_init(void)
(0009) {
(0010)  PORTA = 0x00;
_port_init:
      69 2422      CLR	R2
      6A BA2B      OUT	0x1B,R2
(0011)  DDRA  = 0x00;
      6B BA2A      OUT	0x1A,R2
(0012)  PORTB = 0x00;
      6C BA28      OUT	0x18,R2
(0013)  DDRB  = 0x00;
      6D BA27      OUT	0x17,R2
(0014)  PORTC = 0x00; //m103 output only
      6E BA25      OUT	0x15,R2
(0015)  DDRC  = 0x00;
      6F BA24      OUT	0x14,R2
(0016)  PORTD = 0x00;
      70 BA22      OUT	0x12,R2
(0017)  DDRD  = 0x00;
      71 BA21      OUT	0x11,R2
(0018)  PORTE = 0x00;
      72 B823      OUT	0x03,R2
(0019)  DDRE  = 0x00;
      73 B822      OUT	0x02,R2
(0020)  PORTF = 0x00;
      74 9220 0062 STS	0x0062,R2
(0021)  DDRF  = 0x00;
      76 9220 0061 STS	0x0061,R2
(0022)  PORTG = 0x00;
      78 9220 0065 STS	0x0065,R2
(0023)  DDRG  = 0x00;
      7A 9220 0064 STS	0x0064,R2
      7C 9508      RET
(0024) }
(0025) 
(0026) //call this routine to initialize all peripherals
(0027) void init_devices(void)
(0028) {
(0029)  //stop errant interrupts until set up
(0030)  CLI(); //disable all interrupts
_init_devices:
      7D 94F8      BCLR	7
(0031)  XDIV  = 0x00; //xtal divider
      7E 2422      CLR	R2
      7F BE2C      OUT	0x3C,R2
(0032)  XMCRA = 0x00; //external memory
      80 9220 006D STS	0x006D,R2
(0033)  port_init();
      82 DFE6      RCALL	_port_init
(0034) 
(0035)  MCUCR = 0x00;
      83 2422      CLR	R2
      84 BE25      OUT	0x35,R2
(0036)  EICRA = 0x00; //extended ext ints
      85 9220 006A STS	0x006A,R2
(0037)  EICRB = 0x00; //extended ext ints
      87 BE2A      OUT	0x3A,R2
(0038)  EIMSK = 0x00;
      88 BE29      OUT	0x39,R2
(0039)  TIMSK = 0x00; //timer interrupt sources
      89 BE27      OUT	0x37,R2
(0040)  ETIMSK = 0x00; //extended timer interrupt sources
      8A 9220 007D STS	0x007D,R2
(0041)  SEI(); //re-enable interrupts
      8C 9478      BSET	7
      8D 9508      RET
_delay:
  x                    --> R16
  y                    --> R18
  z                    --> R20
      8E 934A      ST	R20,-Y
(0042)  //all peripherals are now initialized
(0043) }
(0044) 
(0045) void delay()
(0046) {
(0047)  unsigned char x,y,z;
(0048)  for(x=0;x<127;x++)
      8F 2700      CLR	R16
      90 C00B      RJMP	0x009C
(0049)    for(y=0;y<127;y++)
      91 2722      CLR	R18
      92 C006      RJMP	0x0099
(0050)      for(z=0;z<127;z++);
      93 2744      CLR	R20
      94 C001      RJMP	0x0096
      95 9543      INC	R20
      96 374F      CPI	R20,0x7F
      97 F3E8      BCS	0x0095
      98 9523      INC	R18
      99 372F      CPI	R18,0x7F
      9A F3C0      BCS	0x0093
      9B 9503      INC	R16
      9C 370F      CPI	R16,0x7F
      9D F398      BCS	0x0091
      9E 9149      LD	R20,Y+
      9F 9508      RET
(0051) }
(0052) 
(0053) void main(void)
(0054) {
(0055)  init_devices();
_main:
      A0 DFDC      RCALL	_init_devices
(0056)  //insert your functional code here...
(0057)  DDRA=0x0F;
      A1 E08F      LDI	R24,0xF
      A2 BB8A      OUT	0x1A,R24
(0058)  for(;;){
(0059)   PORTA=0x00;
      A3 2422      CLR	R2
      A4 BA2B      OUT	0x1B,R2
(0060)   delay();
      A5 DFE8      RCALL	_delay
(0061)   PORTA=0x0D;
      A6 E08D      LDI	R24,0xD
      A7 BB8B      OUT	0x1B,R24
(0062)   delay();
      A8 DFE5      RCALL	_delay
(0063)   PORTA=0x0B;
      A9 E08B      LDI	R24,0xB
      AA BB8B      OUT	0x1B,R24
(0064)   delay();
      AB DFE2      RCALL	_delay
(0065)   PORTA=0x07;
      AC E087      LDI	R24,7
      AD BB8B      OUT	0x1B,R24
(0066)   delay();
      AE DFDF      RCALL	_delay
(0067)   PORTA=0x0B;
      AF E08B      LDI	R24,0xB
      B0 BB8B      OUT	0x1B,R24
(0068)   delay();
      B1 DFDC      RCALL	_delay
(0069)   PORTA=0x0D;
      B2 E08D      LDI	R24,0xD
      B3 BB8B      OUT	0x1B,R24
(0070)   delay();
      B4 DFD9      RCALL	_delay
(0071)   PORTA=0x0E;
      B5 E08E      LDI	R24,0xE
      B6 BB8B      OUT	0x1B,R24
(0072)   delay();
FILE: <library>
      B7 DFD6      RCALL	_delay
      B8 CFEA      RJMP	0x00A3
      B9 9508      RET

⌨️ 快捷键说明

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