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

📄 main.s

📁 mega128+时实时钟日期芯片ds1307的例子
💻 S
字号:
	.module main.c
	.area text(rom, con, rel)
	.dbfile F:\cdy笔记本资料\E\工程\五星\设计文档\程序设计\ds1307\main.c
	.dbfunc e main _main fV
;           str2 -> y+22
;           str1 -> y+2
	.even
_main::
	sbiw R28,25
	.dbline -1
	.dbline 26
; /*--------------------------------------------------*/
; /*             AVR-ARM开发网论坛                    */
; /*           http://www.avrarm.com                  */
; /*            AVR生成代码测试程序                   */
; /*--------------------------------------------------*/
; /*     程序由AVR辅助开发工具V2.0.0自动生成          */
; /*     AVR系统的处理器为:   ATMega16               */
; /*     AVR系统的晶振频率:   8.0000 Mhz             */
; /*--------------------------------------------------*/
; 
; #include <iom128v.h>
; #include <macros.h>
; #include "twi.h"
; #include "ds1307.h"
; #include "stdlib.h"
; #include "string.h"
; #include "ocmj_lcd.h"
; #include "delay.h"
; 
; 
; 
; //-----------------------------------------------------------
; //主函数
; //-----------------------------------------------------------
; void main(void)
; {
	.dbline 29
;    char str1[20],str2[3];
; 
;    CLI();
	cli
	.dbline 30
;     TWI_Init();
	xcall _TWI_Init
	.dbline 31
;     ocmj_init();
	xcall _ocmj_init
	.dbline 34
;    //rtc_write(0x00,0x00,0x01);
;  
;    SEI();
	sei
	.dbline 35
;    ocmj_write(0xf4);                     //显示清屏
	ldi R16,244
	xcall _ocmj_write
	.dbline 36
;    delay_nms(1); 
	ldi R16,1
	ldi R17,0
	xcall _delay_nms
	.dbline 37
;    asc_tran(3,0,"Welcome to");
	ldi R24,<L2
	ldi R25,>L2
	std y+1,R25
	std y+0,R24
	clr R18
	ldi R16,3
	xcall _asc_tran
	.dbline 38
;    asc_tran(1,8,"www.avrarm.com!");
	ldi R24,<L3
	ldi R25,>L3
	std y+1,R25
	std y+0,R24
	ldi R18,8
	ldi R16,1
	xcall _asc_tran
	.dbline 39
;    delay_nms(800);
	ldi R16,800
	ldi R17,3
	xcall _delay_nms
	.dbline 40
;    ocmj_write(0xf4);                    //显示清屏
	ldi R16,244
	xcall _ocmj_write
	xjmp L5
L4:
	.dbline 43
	.dbline 44
	ldi R16,1
	xcall _RtcUpdateData
	.dbline 45
	xcall _RtcBCDToBin
	.dbline 46
	ldi R18,<L7
	ldi R19,>L7
	movw R16,R28
	subi R16,254  ; offset = 2
	sbci R17,255
	xcall _strcpy
	.dbline 48
	ldi R24,10
	ldi R25,0
	std y+1,R25
	std y+0,R24
	lds R18,_g_aTimeBin+6
	clr R19
	movw R16,R28
	subi R16,234  ; offset = 22
	sbci R17,255
	xcall _itoa
	.dbline 49
	movw R18,R28
	subi R18,234  ; offset = 22
	sbci R19,255
	movw R16,R28
	subi R16,254  ; offset = 2
	sbci R17,255
	xcall _strcat
	.dbline 50
	ldi R18,<L9
	ldi R19,>L9
	movw R16,R28
	subi R16,254  ; offset = 2
	sbci R17,255
	xcall _strcat
	.dbline 51
	ldi R24,10
	ldi R25,0
	std y+1,R25
	std y+0,R24
	lds R18,_g_aTimeBin+5
	clr R19
	movw R16,R28
	subi R16,234  ; offset = 22
	sbci R17,255
	xcall _itoa
	.dbline 52
	movw R18,R28
	subi R18,234  ; offset = 22
	sbci R19,255
	movw R16,R28
	subi R16,254  ; offset = 2
	sbci R17,255
	xcall _strcat
	.dbline 53
	ldi R18,<L9
	ldi R19,>L9
	movw R16,R28
	subi R16,254  ; offset = 2
	sbci R17,255
	xcall _strcat
	.dbline 54
	ldi R24,10
	ldi R25,0
	std y+1,R25
	std y+0,R24
	lds R18,_g_aTimeBin+4
	clr R19
	movw R16,R28
	subi R16,234  ; offset = 22
	sbci R17,255
	xcall _itoa
	.dbline 55
	movw R18,R28
	subi R18,234  ; offset = 22
	sbci R19,255
	movw R16,R28
	subi R16,254  ; offset = 2
	sbci R17,255
	xcall _strcat
	.dbline 57
	ldi R18,<L12
	ldi R19,>L12
	movw R16,R28
	subi R16,254  ; offset = 2
	sbci R17,255
	xcall _strcat
	.dbline 58
	ldi R24,10
	ldi R25,0
	std y+1,R25
	std y+0,R24
	lds R18,_g_aTimeBin+2
	clr R19
	movw R16,R28
	subi R16,234  ; offset = 22
	sbci R17,255
	xcall _itoa
	.dbline 59
	movw R18,R28
	subi R18,234  ; offset = 22
	sbci R19,255
	movw R16,R28
	subi R16,254  ; offset = 2
	sbci R17,255
	xcall _strcat
	.dbline 60
	ldi R18,<L14
	ldi R19,>L14
	movw R16,R28
	subi R16,254  ; offset = 2
	sbci R17,255
	xcall _strcat
	.dbline 61
	ldi R24,10
	ldi R25,0
	std y+1,R25
	std y+0,R24
	lds R18,_g_aTimeBin+1
	clr R19
	movw R16,R28
	subi R16,234  ; offset = 22
	sbci R17,255
	xcall _itoa
	.dbline 62
	movw R18,R28
	subi R18,234  ; offset = 22
	sbci R19,255
	movw R16,R28
	subi R16,254  ; offset = 2
	sbci R17,255
	xcall _strcat
	.dbline 63
	ldi R18,<L14
	ldi R19,>L14
	movw R16,R28
	subi R16,254  ; offset = 2
	sbci R17,255
	xcall _strcat
	.dbline 64
	ldi R24,10
	ldi R25,0
	std y+1,R25
	std y+0,R24
	lds R18,_g_aTimeBin
	clr R19
	movw R16,R28
	subi R16,234  ; offset = 22
	sbci R17,255
	xcall _itoa
	.dbline 65
	movw R18,R28
	subi R18,234  ; offset = 22
	sbci R19,255
	movw R16,R28
	subi R16,254  ; offset = 2
	sbci R17,255
	xcall _strcat
	.dbline 66
	ldi R16,244
	xcall _ocmj_write
	.dbline 67
	ldi R24,<L16
	ldi R25,>L16
	std y+1,R25
	std y+0,R24
	clr R18
	clr R16
	xcall _asc_tran
	.dbline 69
	movw R24,R28
	adiw R24,2
	std y+1,R25
	std y+0,R24
	ldi R18,9
	clr R16
	xcall _asc_tran
	.dbline 70
	ldi R16,200
	ldi R17,0
	xcall _delay_nms
	.dbline 71
L5:
	.dbline 42
	xjmp L4
X0:
	.dbline -2
L1:
	adiw R28,25
	.dbline 0 ; func end
	ret
	.dbsym l str2 22 A[3:3]c
	.dbsym l str1 2 A[20:20]c
	.dbend
	.area data(ram, con, rel)
	.dbfile F:\cdy笔记本资料\E\工程\五星\设计文档\程序设计\ds1307\main.c
L16:
	.blkb 17
	.area idata
	.byte 32,'C,'u,'r,'r,'e,'n,'t,32,'t,'i,'m,'e,32,'i,'s
	.byte 0
	.area data(ram, con, rel)
	.dbfile F:\cdy笔记本资料\E\工程\五星\设计文档\程序设计\ds1307\main.c
L14:
	.blkb 2
	.area idata
	.byte 58,0
	.area data(ram, con, rel)
	.dbfile F:\cdy笔记本资料\E\工程\五星\设计文档\程序设计\ds1307\main.c
L12:
	.blkb 2
	.area idata
	.byte 32,0
	.area data(ram, con, rel)
	.dbfile F:\cdy笔记本资料\E\工程\五星\设计文档\程序设计\ds1307\main.c
L9:
	.blkb 2
	.area idata
	.byte 45,0
	.area data(ram, con, rel)
	.dbfile F:\cdy笔记本资料\E\工程\五星\设计文档\程序设计\ds1307\main.c
L7:
	.blkb 2
	.area idata
	.byte 48,0
	.area data(ram, con, rel)
	.dbfile F:\cdy笔记本资料\E\工程\五星\设计文档\程序设计\ds1307\main.c
L3:
	.blkb 16
	.area idata
	.byte 'w,'w,'w,46,'a,'v,'r,'a,'r,'m,46,'c,'o,'m,33,0
	.area data(ram, con, rel)
	.dbfile F:\cdy笔记本资料\E\工程\五星\设计文档\程序设计\ds1307\main.c
L2:
	.blkb 11
	.area idata
	.byte 'W,'e,'l,'c,'o,'m,'e,32,'t,'o,0
	.area data(ram, con, rel)
	.dbfile F:\cdy笔记本资料\E\工程\五星\设计文档\程序设计\ds1307\main.c

⌨️ 快捷键说明

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