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

📄 selfdestruct.s

📁 Microchip平台下的网络程序源码。包括TCP、IP、FTP等等协议的源码!
💻 S
字号:
	.include "p24fxxxx.inc"
	
	goto	PostSelfDestruct	; Make sure this code isn't executed on accident
	.global _SelfDestruct
_SelfDestruct:
	;Write a goto	0 to first possible instruction
	mov		#0x4001, W0
	mov		W0, NVMCON
	clr		W0
	mov		W0, TBLPAG
	;0x040000 0x000000 is a GOTO 0x00000000 program memory instruction
	mov		#0x0000, W2
	mov		#0x0004, W3

	mov		#64, W1
WriteProgramLatches:
	tblwtl	W2, [W0]
	tblwth	W3, [W0++]
	dec		W1, W1
	bra		NZ, WriteProgramLatches

	disi	#5
	mov		#0x55, W0
	mov		W0, NVMKEY
	mov		#0xAA, W1
	mov		W1, NVMKEY
	bset	NVMCON, #WR
	nop
	nop

	reset
PostSelfDestruct:

⌨️ 快捷键说明

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