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

📄 main.s

📁 mp3源码,是自己写的,关于vs1001与CD卡的读取歌曲,和播放.
💻 S
字号:
	.module main.c
	.area data(ram, con, rel)
_songnumber::
	.blkb 1
	.area idata
	.byte 0
	.area data(ram, con, rel)
	.dbfile F:\mine\mp3\MP3\main.c
	.dbsym e songnumber _songnumber c
	.area vector(rom, abs)
	.org 4
	jmp _DREQ
	.area data(ram, con, rel)
	.dbfile F:\mine\mp3\MP3\main.c
	.area text(rom, con, rel)
	.dbfile F:\mine\mp3\MP3\main.c
	.dbfunc e DREQ _DREQ fV
	.even
_DREQ::
	xcall push_lset
	.dbline -1
	.dbline 11
; #include<all.h>
; #include<vs1001k.h>
; #include<sdcom.h>
; #include<fat.h>
; 
; char  songnumber=0;//歌曲编号
; 
; 
; #pragma interrupt_handler DREQ:iv_INT0 //数据缓冲
; void DREQ(void)
; { delay(50);}
	.dbline 11
	ldi R16,50
	ldi R17,0
	xcall _delay
	.dbline -2
	.dbline 11
L1:
	xcall pop_lset
	.dbline 0 ; func end
	reti
	.dbend
	.area lit(rom, con, rel)
L3:
	.byte 'E,'x
	.byte 'i,'t
	.byte 0,0
	.byte 0,0
L4:
	.byte 'S,239
	.byte 'n,48
	.byte 0,0
	.byte 0,0
	.area text(rom, con, rel)
	.dbfile F:\mine\mp3\MP3\main.c
	.dbfunc e main _main fV
;              n -> y+16
;         table3 -> y+8
;         table2 -> y+0
	.even
_main::
	sbiw R28,20
	.dbline -1
	.dbline 15
; 
; 
; void main(void)
; { ulong n;
	.dbline 16
;   uchar table2[8]={0x45,0x78,0x69,0x74,0,0,0,0};
	ldi R24,<L3
	ldi R25,>L3
	movw R30,R28
	ldi R16,8
	ldi R17,0
	st -y,R31
	st -y,R30
	st -y,R25
	st -y,R24
	xcall asgncblk
	.dbline 17
;   uchar table3[8]={0x53,0xef,0x6e,0x30,0,0,0,0};
	ldi R24,<L4
	ldi R25,>L4
	movw R30,R28
	adiw R30,8
	ldi R16,8
	ldi R17,0
	st -y,R31
	st -y,R30
	st -y,R25
	st -y,R24
	xcall asgncblk
	.dbline 18
;   DDRB=0xbb;
	ldi R24,187
	out 0x17,R24
	.dbline 19
;   DDRD=0x02;
	ldi R24,2
	out 0x11,R24
	.dbline 20
;   PORTB=0xff;
	ldi R24,255
	out 0x18,R24
	.dbline 21
;   PORTD=0xff;
	out 0x12,R24
	.dbline 22
;   MCUCR=0x08;//INT0低电平中断 INT1下降沿
	ldi R24,8
	out 0x35,R24
	.dbline 23
;   GICR=0xC0;
	ldi R24,192
	out 0x3b,R24
	.dbline 27
; //  SEI();//开中断
; //  while(1);
;   
;   SPCR=0x50;//高位先 
	ldi R24,80
	out 0xd,R24
	.dbline 28
;   SPSR=0x01;//rat/2
	ldi R24,1
	out 0xe,R24
L5:
	.dbline 29
L6:
	.dbline 29
;   while(sd_init()==0);//等待SD初始化
	xcall _sd_init
	tst R16
	breq L5
	.dbline 30
;   setlight;
	cbi 0x12,1
	.dbline 31
;   vs1001k_reset();//VS1001K复位
	xcall _vs1001k_reset
	.dbline 33
;  
;   GetinBoot();//进入
	xcall _GetinBoot
	.dbline 34
;   GetFatSec();//得到FAT扇区
	xcall _GetFatSec
	.dbline 35
;   SongSector();//得到每首歌的扇区号
	xcall _SongSector
	.dbline 38
;     
;  
;   SEI();//开中断
	sei
	xjmp L9
L8:
	.dbline 40
	lds R16,_songnumber
	xcall _PlaySong
L9:
	.dbline 39
;   while(1)
	xjmp L8
X0:
	.dbline 41
;   PlaySong(songnumber);
;   _NOP();
	nop
	.dbline -2
	.dbline 42
; }  
L2:
	adiw R28,20
	.dbline 0 ; func end
	ret
	.dbsym l n 16 l
	.dbsym l table3 8 A[8:8]c
	.dbsym l table2 0 A[8:8]c
	.dbend

⌨️ 快捷键说明

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