📄 sesh.s
字号:
.module sesh.c
.area text(rom, con, rel)
.dbfile D:\AVR与虚拟仪器光盘\教程与范例代码\LED应用\跑马灯\sesh.c
.dbfunc e port_init _port_init fV
.even
_port_init::
.dbline -1
.dbline 9
; //ICC-AVR application builder : 2007-5-13 15:07:31
; // Target : M32
; // Crystal: 7.3728Mhz
;
; #include <iom32v.h>
; #include <macros.h>
;
; void port_init(void)
; {
.dbline 10
; PORTA = 0x00;
clr R2
out 0x1b,R2
.dbline 11
; DDRA = 0x00;
out 0x1a,R2
.dbline 12
; PORTB = 0x00;
out 0x18,R2
.dbline 13
; DDRB = 0xff;
ldi R24,255
out 0x17,R24
.dbline 14
; PORTC = 0x00;
out 0x15,R2
.dbline 15
; DDRC = 0x00;
out 0x14,R2
.dbline 16
; PORTD = 0x00;
out 0x12,R2
.dbline 17
; DDRD = 0x00;
out 0x11,R2
.dbline -2
L1:
.dbline 0 ; func end
ret
.dbend
.dbfunc e init_devices _init_devices fV
.even
_init_devices::
.dbline -1
.dbline 22
; }
;
; //call this routine to initialize all peripherals
; void init_devices(void)
; {
.dbline 24
; //stop errant interrupts until set up
; CLI(); //disable all interrupts
cli
.dbline 25
; port_init();
xcall _port_init
.dbline 27
;
; MCUCR = 0x00;
clr R2
out 0x35,R2
.dbline 28
; GICR = 0x00;
out 0x3b,R2
.dbline 29
; TIMSK = 0x00; //timer interrupt sources
out 0x39,R2
.dbline 30
; SEI(); //re-enable interrupts
sei
.dbline -2
L2:
.dbline 0 ; func end
ret
.dbend
.dbfunc e main _main fV
.even
_main::
.dbline -1
.dbline 35
; //all peripherals are now initialized
; }
;
; void main(void)
; {
.dbline 36
; init_devices();
xcall _init_devices
xjmp L5
L4:
.dbline 38
.dbline 39
sbi 0x18,0
.dbline 40
L5:
.dbline 37
xjmp L4
X0:
.dbline -2
L3:
.dbline 0 ; func end
ret
.dbend
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -