📄 flasherased.asm
字号:
/* This program checks whether the flash is erased. If the flash is not erased right it gets
stuck here.
Input - Word_To_Write
Output - None */
#include <def21369.h>
.global FLASH_ERASED;
.extern Word_Read_In, External_Sector_Address,External_Byte_Address;
.extern READ_FLASH_WORD;
.section/pm seg_pmco;
FLASH_ERASED:
r2 = 0;
r0 = dm(External_Sector_Address);
dm(External_Byte_Address)=r0;
call READ_FLASH_WORD; //Read the data in the flash
r11 = dm(Word_Read_In); nop;
call READ_FLASH_WORD; //Read the data again
r10 = dm(Word_Read_In); nop;
r11 = r11-r10; //compares whether both the datas read are identical
if ne jump FLASH_ERASED;
r12 = 0x000000ff;
r11 = r12 - r10; //compares the last data byte read with FF
if ne jump FLASH_ERASED;
nop;
rts;
FLASH_ERASED.END:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -