ATMEL AVR 单片机开发套件和大量C和ASM代码工程

源代码在线查看: readwriteeeprom.s

软件大小: 52587 K
上传用户: rylzll
关键词: ATMEL ASM AVR 单片机
下载地址: 免注册下载 普通下载 VIP

相关代码

					.module ReadWriteEEPROM.c
					.area text
					.dbfile E:\grc\licc\例子10.3.3\ReadWriteEEPROM.c
					.dbfunc s main _main fI
				;           temp -> R20
				;              i -> R20
					.even
				_main::
					.dbline 7{
				; // These work for devices with more than 256 bytes of EEPROM
				; //int EEPROMwrite( int location, unsigned char);
				; //unsigned char EEPROMread( int);
				; #include 
				; #include 
				; void main(void)
				; {
					.dbline 8
				;   unsigned char temp =0xaa,i;
					ldi R20,170
					.dbline 9
				;     EEPROMwrite(0x20,temp); /* 写E2PROM 地址0x20  */
					mov R18,R20
					ldi R16,32
					ldi R17,0
					rcall _EEPROMwrite
					.dbline 10
				;     i=EEPROMread(0x20);     /* 读E2PROM 地址 0x20 */
					ldi R16,32
					ldi R17,0
					rcall _EEPROMread
					mov R20,R16
					.dbline 11
				; 	 i++;
					inc R20
					.dbline 12
				; 	EEPROMwrite(0x30,i);
					mov R18,R20
					ldi R16,48
					ldi R17,0
					rcall _EEPROMwrite
					.dbline 13}
				; }     
				L1:
					ret
					.dbsym r temp 20 c
					.dbsym r i 20 c
							

相关资源