📄 exam_1.lst
字号:
__start:
__text_start:
0013 E5CF LDI R28,0x5F
0014 E0D4 LDI R29,4
0015 BFCD OUT 0x3D,R28
0016 BFDE OUT 0x3E,R29
0017 51C0 SUBI R28,0x10
0018 40D0 SBCI R29,0
0019 EA0A LDI R16,0xAA
001A 8308 STD Y+0,R16
001B 2400 CLR R0
001C E6E0 LDI R30,0x60
001D E0F0 LDI R31,0
001E E010 LDI R17,0
001F 36E0 CPI R30,0x60
0020 07F1 CPC R31,R17
0021 F011 BEQ 0x0024
0022 9201 ST R0,Z+
0023 CFFB RJMP 0x001F
0024 8300 STD Z+0,R16
0025 E2E6 LDI R30,0x26
0026 E0F0 LDI R31,0
0027 E6A0 LDI R26,0x60
0028 E0B0 LDI R27,0
0029 E010 LDI R17,0
002A 32E6 CPI R30,0x26
002B 07F1 CPC R31,R17
002C F021 BEQ 0x0031
002D 95C8 LPM
002E 9631 ADIW R30,1
002F 920D ST R0,X+
0030 CFF9 RJMP 0x002A
0031 D016 RCALL _main
_exit:
0032 CFFF RJMP _exit
FILE: D:\工作\SolidSnake\Snake_Exam\Example_1\main.c
(0001) //ICC-AVR application builder : 2007-05-11 11:05:23
(0002) // Target : M8
(0003) // Crystal: 11.059Mhz
(0004)
(0005) #include <iom8v.h>
(0006) #include <macros.h>
(0007)
(0008) void port_init(void)
(0009) {
(0010) PORTB = 0xFF;
_port_init:
0033 EF8F LDI R24,0xFF
0034 BB88 OUT 0x18,R24
(0011) DDRB = 0x00;
0035 2422 CLR R2
0036 BA27 OUT 0x17,R2
(0012) PORTC = 0x7F; //m103 output only
0037 E78F LDI R24,0x7F
0038 BB85 OUT 0x15,R24
(0013) DDRC = 0x00;
0039 BA24 OUT 0x14,R2
(0014) PORTD = 0xFF;
003A EF8F LDI R24,0xFF
003B BB82 OUT 0x12,R24
(0015) DDRD = 0x60;
003C E680 LDI R24,0x60
003D BB81 OUT 0x11,R24
(0016) }
003E 9508 RET
(0017)
(0018) //call this routine to initialise all peripherals
(0019) void init_devices(void)
(0020) {
(0021) //stop errant interrupts until set up
(0022) CLI(); //disable all interrupts
_init_devices:
003F 94F8 BCLR 7
(0023) port_init();
0040 DFF2 RCALL _port_init
(0024)
(0025) MCUCR = 0x00;
0041 2422 CLR R2
0042 BE25 OUT 0x35,R2
(0026) GICR = 0x00;
0043 BE2B OUT 0x3B,R2
(0027) TIMSK = 0x04; //timer interrupt sources
0044 E084 LDI R24,4
0045 BF89 OUT 0x39,R24
(0028) SEI(); //re-enable interrupts
0046 9478 BSET 7
(0029) //all peripherals are now initialised
(0030) }
0047 9508 RET
(0031)
(0032) void main(void)
(0033) {
(0034) init_devices();
_main:
0048 DFF6 RCALL _init_devices
(0035)
(0036) PORTD &= 0b11011111; //LED1亮
0049 B382 IN R24,0x12
004A 7D8F ANDI R24,0xDF
004B BB82 OUT 0x12,R24
(0037)
(0038) //PORTD &= 0b10111111; //LED2亮
(0039) }
FILE: <library>
004C 9508 RET
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -