#define TURE 1
#define FALSE 0
#define INVALID -1
#define NULL 0
#define total_instruction 320
#define total_vp 32
#define clear_period 50
typedef struct{
int pn,pfn,counter,time;
}
pl_type;
pl_type pl[total_vp];
struct pfc_struct{
int pn,pfn;
struct pfc_struct *next;
};
typedef struct pfc_struct pfc_type;
pfc_type pfc[total_vp], *freepf_head, *busypf_head, *busypf_tail;
int diseffect, a[total_instruction];
int page[total_instruction], offset[total_instruction];
void initialize();
void fifo();
void lru();
#include
#include
main()
{
int s,i,j;
srand(getpid()*10);
s=(float)319*rand()/32767+1;
for(i=0;inext;
freepf_head->next=NULL;