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

📄 base.asm

📁 老外个人做的MP3/优盘。使用ATMEL MEGA系列的MCU
💻 ASM
字号:
/* ***********************************************************************
**
**  Copyright (C) 2002  Jesper Hansen <jesperh@telia.com> and 
**			Romuald Bialy (MIS) <romek_b@o2.pl>.
**
**
**  Yampp-3/USB - low level support library
**
**
*************************************************************************
**
**   This file is part of the yampp system.
**
**  This program is free software; you can redistribute it and/or
**  modify it under the terms of the GNU General Public License
**  as published by the Free Software Foundation; either version 2
**  of the License, or (at your option) any later version.
**
**  This program is distributed in the hope that it will be useful,
**  but WITHOUT ANY WARRANTY; without even the implied warranty of
**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
**  GNU General Public License for more details.
**
**  You should have received a copy of the GNU General Public License
**  along with this program; if not, write to the Free Software Foundation, 
**  Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
**
*************************************************************************
**
**  Revision History
**
**  when         what  who	why
**
**  2002-09-01   1.0   MIS      initial public release
**
*********************************************************************** */

#define __ASSEMBLER__ 1
#define __SFR_OFFSET 0
#include <avr/io.h>
//#include <io-avr.h>

#define __tmp_reg__		r0
#define __zero_reg__	r1


	.section	.text


;************************************************
;* 
;* I/O stuff and EXTRAM handling
;* 
;************************************************

;void ramdisable(void)
	.global ramdisable
ramdisable:
		in 	r25, MCUCR
		andi 	r25, 127
		out 	MCUCR, r25
		ret

;void ramenable(void)
	.global	ramenable		
ramenable:
		in 	r25, MCUCR
		ori 	r25, 128
		out 	MCUCR, r25
		ret

/*

;************************************************
;* 
;* formatting helpers
;* 
;************************************************



; the putchar function for the UART or LCD should
; be like this :
; void func(u08)


.comm outchannel,2		; output channel pointer, UART or LCD (or other)


;				   r25/r24
;void (*func)(u08) setputchar(void (*func)(u08) );
.global setputchar
setputchar:
		lds		r22,outchannel
		lds		r23,outchannel+1
		sts		outchannel,r24
		sts		outchannel+1,r25
		movw	r24,r22
		ret

;void (*func)(u08) getputchar(void);
.global getputchar
getputchar:
		lds		r24,outchannel
		lds		r25,outchannel+1
		ret

;				r24
;void putchar(u08 c)
.global putchar
putchar:
		lds		r30,outchannel		
		lds		r31,outchannel+1		
		ijmp						; use jump instead of call to save a ret
		;ret						; not needed, see above
*/

⌨️ 快捷键说明

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