📄 main.s
字号:
.module main.c
.area text(rom, con, rel)
.dbfile C:\DOCUME~1\administrator\桌面\教程\18B20\main.c
.dbfunc e port_init _port_init fV
.even
_port_init::
.dbline -1
.dbline 11
; // ICC-AVR application builder : 2007-2-14 21:34:00
; // Target : M16
; // Crystal: 7.3728Mhz
; // 18B20 演示程序
;
; #include "config.h"
;
; extern unsigned char count;
;
; void port_init(void)
; {
.dbline 12
; PORTA = 0x00;
clr R2
out 0x1b,R2
.dbline 13
; DDRA = 0x00;
out 0x1a,R2
.dbline 14
; PORTB = 0x00;
out 0x18,R2
.dbline 15
; DDRB = 0x00;
out 0x17,R2
.dbline 16
; PORTC = 0x00; //m103 output only
out 0x15,R2
.dbline 17
; DDRC = 0x00;
out 0x14,R2
.dbline 18
; PORTD = 0x00;
out 0x12,R2
.dbline 19
; 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 24
; }
;
; //call this routine to initialize all peripherals
; void init_devices(void)
; {
.dbline 26
; //stop errant interrupts until set up
; CLI(); //disable all interrupts
cli
.dbline 27
; port_init();
xcall _port_init
.dbline 29
;
; MCUCR = 0x00;
clr R2
out 0x35,R2
.dbline 30
; GICR = 0x00;
out 0x3b,R2
.dbline 31
; TIMSK = 0x00; //timer interrupt sources
out 0x39,R2
.dbline 32
; SEI(); //re-enable interrupts
sei
.dbline -2
L2:
.dbline 0 ; func end
ret
.dbend
.dbfunc e main _main fV
; temp1 -> <dead>
.even
_main::
.dbline -1
.dbline 37
; //all peripherals are now initialized
; }
;
; void main(void)
; {
.dbline 39
; unsigned int temp1;
; init_devices();
xcall _init_devices
xjmp L5
L4:
.dbline 41
.dbline 42
xcall _gettemp
.dbline 43
clr R18
lds R16,_count
clr R17
xcall _display
.dbline 44
L5:
.dbline 40
xjmp L4
X0:
.dbline -2
L3:
.dbline 0 ; func end
ret
.dbsym l temp1 1 i
.dbend
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -