i++;
if (p_MCB->ui_Owner_PID==0){printf(" Free");}
else {
if (p_MCB->ui_Owner_PID < ui_Memtop){ printf(" DOS "); }
else {
if (ui_Seg == p_MCB->ui_Owner_PID-1){ printf(" Pgm ");}
else {
ui_Other_Seg=peek(p_MCB->ui_Owner_PID,0x2c);
ui_Father_Seg=peek(p_MCB->ui_Owner_PID,0x16);
if (ui_Seg == ui_Other_Seg-1){printf(" Env ");}
else{printf(" Data ");}}
if (p_MCB->ui_Owner_PID == ui_Father_Seg){
printf("COMMAND.COM");}
else
{ if (_version > 3)
{
p_EMCB=(MEMORY_CONTROL_BLOCK far *)MK_FP(p_MCB->ui_Owner_PID-1,0);
char *s (p_EMCB->str_Name_Of_Owner);
for (int j=0; j<8; j++)
{
if (*s>0)
printf("%c",*(s++));
else
printf(" ");}
printf(" ");}
if (_version > 2)
{
p_EMCB = (MEMORY_CONTROL_BLOCK far *)MK_FP(ui_Other_Seg-1,0);
i_EnvSize=p_EMCB->ui_Size_Paras*16;
uc_EnvStr=(char *)MK_FP(ui_Other_Seg,0);
do{
i_EnvLen= strlen(uc_EnvStr)+1;
uc_EnvStr+=i_EnvLen; i_EnvSize-=i_EnvLen;
}while ((i_EnvLen>1)&&(i_EnvSize>0));
uc_EnvStr+=2;
i_EnvSize-=2;
if (i_EnvSize>0)
{
printf("%s",uc_EnvStr);
}}}}}
printf("\n");
ui_Seg+=(p_MCB->ui_Size_Paras+1);
if(i==20) {
printf ("Press any key");
getch();
i=0;
delline ();
gotoxy (1,wherey());}
} while (p_MCB->c_Signature!='Z');
getch();
clrscr();
Get_Strategy ();
cout << endl;
cout << "Enter the stratagy of memory allocations" << endl;
cout << "0 - FIRST_FIT_LOW" << endl;
cout << "1 - BEST_FIT_LOW" << endl;
cout << "2 - LAST_FIT_LOW" << endl;
cout << "3 - FIRST_FIT_HIGH" << endl;
cout << "4 - BEST_FIT_HIGH" << endl;
cout << "5 - LAST_FIT_HIGH" << endl;
cout << "6 - FIRST_FIT_HIGHONLY" << endl;
cout << "7 - BEST_FIT_HIGHONLY" << endl;
cout << "8 - LAST_FIT_HIGHONLY" << endl;
cout << ">";
cin >> i;
Set_Strategy (i);}
void Set_Strategy(int i_Strategy)
{
switch (i_Strategy)
{
case 0:{
asm xor bx,bx
asm xor ax,ax
asm mov ax,0x5801
asm mov bx, 0x0//FIRST_FIT_LOW
asm int 0x21
break;}
case 1:{
asm xor bx,bx
asm xor ax,ax
asm mov ax,0x5801
asm mov bx,0x0001// BEST_FIT_LOW
asm int 0x21
break;}
case 2:{
asm xor bx,bx
asm xor ax,ax
Уважаемый посетитель!
Чтобы распечатать файл, скачайте его (в формате Word).
Ссылка на скачивание - внизу страницы.