Chapter 3/ Hardware Briefing
The implementation of this rule is fairly direct. As an experiment, you
could (given the address of the first MCB) use the debug command to dump
memory and follow the MCB chain manually. The address of an MCB will
always reside at the start of a segment (aligned on a paragraph boundary), so
the offset address will always be zero. We can just add values directly to the
segment address to find the next one.
struct MCBHeader getNextMCB
(
struct Address currentAddr,
struct MCB currentMCB
)
{
WORD nextSegment;
WORD nextOffset;
struct MCBHeader newHeader;
nextSegment = currentAddr.segment;
nextOffset = 0x0000;
nextSegment = nextSegment + 1;
nextSegment = naxtSegirient + currentMCB. size;
pri ntArenaAddress(nextSegment,nextOffset);
(newHeader.address).segment = nextSegment;
(newHeader.address).offset = nextOffset;
newHeader = populateMCB(newHeader.address);
return(newHeader);
}
If we find an MCB that we want to hide, we simply update the size of its preĀ¬
decessor so that the MCB to be hidden gets skipped over the next time that
the MCB chain is traversed.
void hideApp
(
struct MCBHeader oldHdr,
struct MCBHeader currentHdr
)
{
WORD segmentFix;
WORD sizeFix;
segmentFix = (oldHdr.address).segment;
sizeFIx = (oldHdr.mcb).size + 1 + (currentHdr.mcb).size;