From Matthew Probert · 1996-04-02 13:01 · #75189 in R25C
Identifying ROM Code
Matthew Probert
Servile Software
Have you ever wondered how to identify whether a memory address is
mapped to ROM or RAM ? Well, ROM code may be identified by the
signature word 55AA which occurs at the start of each ROM segment.
This code fragment will scan the memory addresses from C0000 (segment
C000) onwards untill it locates RAM (based upon the presumption that
the first two bytes of the memory segment do not contain the values
55 and AA). The pointer 'q' is a standard far pointer.
/*
Initialise unsigned seg to the start of the PC ROM expansion
area
*/
seg = 0xc000;
/*
Step past ROM untill RAM is found, or the BIOS whichever comes
first
*/
for(;;)
{
q = MK_FP(seg,0);
if (*q != 0x55 || *(q+1) != 0xAA)
break;
seg += 0x80;
}
... [Servile Info Journal]
___ Blue Wave/QWK v2.12
--- WILDMAIL!/WC v4.12
* Origin: Ooh! LONDON [LiveChat-MultiLines] 0181-395-3108 (2:254/233.0)