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

📄 erase0.asm

📁 一款MP3 Player Firmware 的原代码,非常有参考价值
💻 ASM
字号:
; MP3 Player, Main Program Erase, http://www.pjrc.com/tech/mp3; Copyright (c) 2000, PJRC.COM, LLC; 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.; this little utility adds a quick and easy command to the; board (press 'X') to erase just the program (player.hex),; so when working on the firmware, you can press 'X' and the; download just the main program instead of all the data.; This speeds things up quite a bit..equ    location, 0xED00        ;where this program will exist.equ    pstr, 0x0038            ;Print string pointed to by DPTR,.equ    erblock, 0x0067   ;PAULMON2 v2.1 req'd.equ    call_bank1, 0x0FE0.org    location.db     0xA5,0xE5,0xE0,0xA5     ;signiture bytes.db     254,'X',0,0             ;id.db     0,0,0,0                 ;reserved.db     0,0,0,0                 ;reserved.db     0,0,0,0                 ;reserved.db     0,0,0,0                 ;reserved.db     0,0,0,0                 ;user defined.db     255,255,255,255         ;length and checksum (255=unused).db     "Erase C Code Only          'X'",0.org    location+64             ;executable code begins here	mov     dptr, #mesg_warn	lcall   pstrbegin1:	mov	dptr, #0x3000	mov	a, #0x24	lcall	erblock	mov	dptr, #0x4000	mov	a, #0x24	lcall	erblock	mov	dptr, #0x5000	mov	a, #0x24	lcall	erblock	mov	dptr, #0x6000	mov	a, #0x24	lcall	erblock	mov	dptr, #0x7000	mov	a, #0x24	lcall	erblock	mov	dptr, #0x8000	mov	a, #0x24	lcall	erblock	mov	dptr, #0x9000	mov	a, #0x24	lcall	erblock	mov	dptr, #0xA000	mov	a, #0x24	lcall	erblock	mov	dptr, #0xB000	mov	a, #0x24	lcall	erblock	mov	dptr, #0xC000	mov	a, #0x24	lcall	erblock	mov	dptr, #0xD000	mov	a, #0x24	lcall	erblock	mov	dptr, #0xF000	;erases old (non-SIMM) version	mov	a, #0x24	lcall	erblock	mov	dptr, #0x3000chk:	clr	a	movc	a, @a+dptr	cpl	a	jnz	bad	inc	dptr	mov	a, dpl	jnz	chk	mov	a, dph	cjne	a, #0xE0, chk	mov     dptr, #mesg_p	lcall   pstr	mov     dptr, #mesg_ok	lcall   pstr	retbad:	mov     dptr, #mesg_p	lcall   pstr	mov     dptr, #mesg_er	lcall   pstr	retmesg_p:	.db	"Partial Flash Erasure, ",0mesg_ok:.db	"OK", 13,10,13,10,0mesg_er:.db     "Failed", 13,10,13,10,0.org    location+256.db     0xA5,0xE5,0xE0,0xA5     ;signiture bytes.db     254,'Y',0,0             ;id.db     0,0,0,0                 ;reserved.db     0,0,0,0                 ;reserved.db     0,0,0,0                 ;reserved.db     0,0,0,0                 ;reserved.db     0,0,0,0                 ;user defined.db     255,255,255,255         ;length and checksum (255=unused).db     "Erase C Code and Drivers   'Y'",0.org    location+256+64         ;executable code begins here	mov     dptr, #mesg_warn	lcall   pstr	mov	dptr, #0xFF40	lcall	call_bank1	mov	dptr, #0x2000	mov	a, #0x24	lcall	erblock	mov	dptr, #0x2000chk2:	clr	a	movc	a, @a+dptr	cpl	a	jnz	bad2	inc	dptr	mov	a, dpl	jnz	chk2	mov	a, dph	cjne	a, #0x30, chk2	ajmp	begin1bad2:	ajmp	badmesg_warn:.db	13,10,"Partial Flash Erasure For Developers Only",13,10.db	"  Users should erase with 'Z' command",13,10.db	"  and download 'MP3PLAYER.HEX'".db	13,10,13,10,0

⌨️ 快捷键说明

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