



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




#include <stdio.h> #include <conio.h> #include <bios.h> #include <dos.h>
typedef struct tagMCB { unsigned char sig; unsigned int pspseg; unsigned int paras; unsigned char reserved[11]; }MCB;
void main (void) { unsigned int seg,off; unsigned int far * temp; unsigned long i; char st[20]; MCB far * pmcb; _AH=0x52; geninterrupt(0x21);
seg = _ES; off = _BX; off = off- 4; temp = (unsigned int far *) MK_FP(seg,off); seg = (temp+1); pmcb = (MCB far )MK_FP(seg,temp); while (pmcb->sig == 'M') { printf("\nSegment Address of PSP is %x",pmcb->pspseg); printf("\nNo of Paras controlled by MCB = % x\n",pmcb->paras); seg = seg + pmcb->paras + 1; pmcb = (MCB far )MK_FP(seg,temp); } if (pmcb->sig == 'Z') { printf("\nLast MCB found"); printf("\nNo of free Paras = %x",pmcb->paras); i = (pmcb->paras)16L; ltoa(i,st,10); printf("\nLargest contigous block = " ); puts (st); } }
Limit (L15 โ L0)
Base (B15 โ B0)
Access Base(B23- B16) Rights
Reserved
Lim (L15 โ L0)
Base (B15 โ B0)
Access Base(B23-B16) Rights
Base A Limit (B24 โ B31) G D 0 V (L16 โ L 19) L
Lim (L15 โ L0)
Base (B15 โ B0)
Base(B23-B16) P DPL 0 TYPE
Base Limit (B24 โ B31) G 0 0 0 (L16 โ L19)^6