#include <stdio.h>
void main(void)
{
unsigned long cnt,cnt1,addr;
unsigned short seg,offset;
char fError;
cnt1 = cnt = 0x00;
for(addr=0xFFFFF; addr>0xA0000; addr-=0x100)
{
fError = 0x00;
seg = (addr&0xF0000)>>4;
offset = addr&0xFFFF;
asm push ds
asm push si
asm push ax
asm mov si,offset
asm mov ax,seg
asm mov ds,ax
asm mov byte ptr ds:[si],0x55
asm mov byte ptr ds:[si-1],0xAA
asm mov al,byte ptr ds:[si]
asm cmp al,0x55
asm je ok55
asm mov byte ptr fError,0x01
ok55:
asm mov al,byte ptr ds:[si-1]
asm cmp al,0xAA
asm je okaa
asm mov byte ptr fError,0x01
okaa:
asm pop ax
asm pop si
asm pop ds
if(fError)
{
if(cnt1)
{
cnt1 = 0;
printf("/n====================/n");
getch();
}
printf("/n Error Addr:%04X-%04X",seg,offset);
cnt++;
if(cnt%16 == 0)
{
printf("/n********************");
getch();
}
}
else
{
if(cnt)
{
cnt = 0;
printf("/n********************");
getch();
}
printf("/n OK:%04X-%04X",seg,offset);
cnt1++;
if(cnt1%0x10 == 0)
{
printf("/n====================/n");
getch();
}
}
}
}
list 0xA0000到0xFFFFF之间的ROM地址
最新推荐文章于 2022-11-26 18:37:38 发布